From 418fd1b473ee2894834547194a04fa4837449306 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 18 Feb 2022 06:06:30 +0100 Subject: [PATCH 1/4] Switch yamllint github action --- .../workflows/{yaml-lint.yml => yamllint.yml} | 20 ++++++++++--------- .../.github/workflows/linting.yml | 20 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) rename .github/workflows/{yaml-lint.yml => yamllint.yml} (63%) diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yamllint.yml similarity index 63% rename from .github/workflows/yaml-lint.yml rename to .github/workflows/yamllint.yml index 13a7aa23b4..7ea6f383ae 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yamllint.yml @@ -4,12 +4,13 @@ jobs: YAML: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v2 - - name: Install yaml-lint - run: npm install -g yaml-lint - - name: Run yaml-lint - run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml + - name: Checkout + uses: actions/checkout@master + - name: 'Yamllint' + uses: karancode/yamllint-github-action@master + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: '.yamllint.yml' # If the above check failed, post a comment on the PR explaining the failure - name: Post PR comment @@ -22,10 +23,11 @@ jobs: To keep the code consistent with lots of contributors, we run automated code consistency checks. To fix this CI test, please run: - * Install `yaml-lint` - * [Install `npm`](https://www.npmjs.com/get-npm) then [install `yaml-lint`](https://www.npmjs.com/package/yaml-lint) (`npm install -g yaml-lint`) + * Install `yamllint` + * Install `yamllint` following [this](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) + instructions or alternative install it in your [conda environment](https://anaconda.org/conda-forge/yamllint) * Fix the markdown errors - * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ./.yamllint.yml` + * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml` * Fix any reported errors in your YAML files Once you push these changes the test should pass, and you can hide this comment :+1: diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index 554cb41b49..a451149097 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -60,12 +60,13 @@ jobs: YAML: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v2 - - name: Install yaml-lint - run: npm install -g yaml-lint - - name: Run yaml-lint - run: yamllint $(find ${GITHUB_WORKSPACE} -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml + - name: Checkout + uses: actions/checkout@master + - name: 'Yamllint' + uses: karancode/yamllint-github-action@master + with: + yamllint_file_or_dir: '.' + yamllint_config_filepath: '.yamllint.yml' # If the above check failed, post a comment on the PR explaining the failure - name: Post PR comment @@ -78,10 +79,11 @@ jobs: To keep the code consistent with lots of contributors, we run automated code consistency checks. To fix this CI test, please run: - * Install `yaml-lint` - * [Install `npm`](https://www.npmjs.com/get-npm) then [install `yaml-lint`](https://www.npmjs.com/package/yaml-lint) (`npm install -g yaml-lint`) + * Install `yamllint` + * Install `yamllint` following [this](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) + instructions or alternative install it in your [conda environment](https://anaconda.org/conda-forge/yamllint) * Fix the markdown errors - * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ./.yamllint.yml` + * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml` * Fix any reported errors in your YAML files Once you push these changes the test should pass, and you can hide this comment :+1: From b2e0712fd1279e59eb6068fb6af25b4128da3fd8 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 24 Feb 2022 14:37:43 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7617a723d2..c04d8cf3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ * Shiny new command-line help formatting ([#1403](https://github.com/nf-core/tools/pull/1403)) * Call the command line help with `-h` as well as `--help` (was formerly just the latter) ([#1404](https://github.com/nf-core/tools/pull/1404)) * Add `.yamllint.yml` config file to avoid line length and document start errors in the tools repo itself. +* Switch to `yamllint-github-action`to be able to configure yaml lint exceptions ([#1404](https://github.com/nf-core/tools/issues/1413)) ### Modules From 381d6b278f8f28b1ecc9c3ddbe5b4d629b5555b2 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 24 Feb 2022 15:23:31 +0100 Subject: [PATCH 3/4] Fix messages when yaml lint fails --- .github/workflows/yamllint.yml | 2 +- nf_core/pipeline-template/.github/workflows/linting.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 7ea6f383ae..f0155a3c60 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -27,7 +27,7 @@ jobs: * Install `yamllint` following [this](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) instructions or alternative install it in your [conda environment](https://anaconda.org/conda-forge/yamllint) * Fix the markdown errors - * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml` + * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ./.yamllint.yml` * Fix any reported errors in your YAML files Once you push these changes the test should pass, and you can hide this comment :+1: diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index a451149097..76449396ee 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -83,7 +83,7 @@ jobs: * Install `yamllint` following [this](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) instructions or alternative install it in your [conda environment](https://anaconda.org/conda-forge/yamllint) * Fix the markdown errors - * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ${GITHUB_WORKSPACE}/.yamllint.yml` + * Run the test locally: `yamllint $(find . -type f -name "*.yml" -o -name "*.yaml") -c ./.yamllint.yml` * Fix any reported errors in your YAML files Once you push these changes the test should pass, and you can hide this comment :+1: From 426c157c8c1a167de6067dc9becb70f8aaee16c8 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 24 Feb 2022 17:40:35 +0100 Subject: [PATCH 4/4] Disable truthy checks --- .yamllint.yml | 1 + nf_core/pipeline-template/.yamllint.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.yamllint.yml b/.yamllint.yml index e214bcc350..05d5352339 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -4,3 +4,4 @@ ignore: | rules: document-start: disable line-length: disable + truthy: disable diff --git a/nf_core/pipeline-template/.yamllint.yml b/nf_core/pipeline-template/.yamllint.yml index 6889fa342e..d466deec92 100644 --- a/nf_core/pipeline-template/.yamllint.yml +++ b/nf_core/pipeline-template/.yamllint.yml @@ -3,3 +3,4 @@ extends: default rules: document-start: disable line-length: disable + truthy: disable