diff --git a/.github/README.md b/.github/README.md index fcb2dc2..10c543a 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,12 +1,22 @@ # matlab-project-template -This is a template repository you can use for your MATLAB software project. It pre-populates essential files and directory structure when you use this template to create the repository for your project. + +This is a template repository you can use for your MATLAB software project. It +pre-populates essential files and directory structure when you use this template +to create the repository for your project. ## Getting started -Click **Use this template**, then select **Create a new repository** and then fill in the essential information for your repository. Then a repository that utilises this template will be created for you. -More detailed instructions can be found [here]('https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template'). + +Click **Use this template**, then select **Create a new repository** and then +fill in the essential information for your repository. Then a repository that +utilises this template will be created for you. More detailed instructions can +be found +[here]('https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template'). ## After the repository has been created -You will need to make changes to some of the placeholder content in the files in your new repository. See more instructions in the README file in the new repository. + +You will need to make changes to some of the placeholder content in the files in +your new repository. See more instructions in the README file in the new +repository. [![Test](https://github.com/reproducibleMATLAB/matlab-project-template/actions/workflows/test.yaml/badge.svg)](https://github.com/reproducibleMATLAB/matlab-project-template/actions/workflows/test.yaml) diff --git a/.github/workflows/checkcode.yaml b/.github/workflows/checkcode.yaml new file mode 100644 index 0000000..9e51968 --- /dev/null +++ b/.github/workflows/checkcode.yaml @@ -0,0 +1,49 @@ +--- +name: Checkcode + +on: + push: + branches: + - main + pull_request: + +concurrency: + cancel-in-progress: true + group: >- + ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + +jobs: + directories: + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Get directories + id: directories + run: >- + echo directories=$(find . -type d -mindepth 1 -not -path '*/\.*' | sed + 's/^..//' | jq -R -s -c 'split("\n")[:-1]') >> $GITHUB_OUTPUT + outputs: + directories: ${{ steps.directories.outputs.directories }} + + checkcode: + needs: directories + runs-on: ubuntu-latest + strategy: + matrix: + directory: ${{ fromJson(needs.directories.outputs.directories) }} + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Set up MATLAB + uses: matlab-actions/setup-matlab@v2 + + - name: Move into ${{ matrix.directory }} directory + run: cd ${{ github.workspace }}/${{ matrix.directory }} + + - name: Run MATLAB Command + uses: matlab-actions/run-command@v2 + with: + command: mlintrpt diff --git a/README.md b/README.md index aeb650e..74046f5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PROJECT-NAME -(Add one line summary of what it does) +(Add one line summary of what it does) ## TODO Upon Project Creation @@ -20,21 +20,24 @@ First, clone this repository: -``` -# Clone this repository +```sh git clone https://github.com//.git cd ``` -Alternatively, download the code as a .zip folder by clicking the "Code" button on GitHub. +Alternatively, download the code as a .zip folder by clicking the "Code" button +on GitHub. ## Contributing - is an open-source project and we welcome contributions from the community. + is an open-source +project, and we welcome contributions from the community. -If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome. +If you'd like to contribute, please fork the repository and make changes as +you'd like. Pull requests are warmly welcome. ### Our Contributors + diff --git a/tests/source/scripts/main.m b/tests/source/scripts/main.m index 2625fd4..df3f6c9 100644 --- a/tests/source/scripts/main.m +++ b/tests/source/scripts/main.m @@ -2,4 +2,4 @@ function out = main(variable) % your code here % -end \ No newline at end of file +end diff --git a/tests/source/scripts/mainRun.m b/tests/source/scripts/mainRun.m index a68ace0..d08c87b 100644 --- a/tests/source/scripts/mainRun.m +++ b/tests/source/scripts/mainRun.m @@ -1,2 +1,2 @@ % Execute the runtests function to run the four tests in main.m -results = runtests('main'); \ No newline at end of file +results = runtests('main'); diff --git a/tests/source/scripts/mainTest.m b/tests/source/scripts/mainTest.m index fb3f902..a7639d8 100644 --- a/tests/source/scripts/mainTest.m +++ b/tests/source/scripts/mainTest.m @@ -3,4 +3,3 @@ % This unit test can use assert to check different outputs of main % function -