Skip to content

Commit

Permalink
Merge pull request #1422 from JoseEspinosa/yamllint_fix
Browse files Browse the repository at this point in the history
Make yamllint config recognisable by the yml lint github action
  • Loading branch information
JoseEspinosa authored Feb 24, 2022
2 parents a1bf2ad + 426c157 commit f1143c2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/yaml-lint.yml → .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,8 +23,9 @@ 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`
* Fix any reported errors in your YAML files
Expand Down
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ignore: |
rules:
document-start: disable
line-length: disable
truthy: disable
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 10 additions & 8 deletions nf_core/pipeline-template/.github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -78,8 +79,9 @@ 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`
* Fix any reported errors in your YAML files
Expand Down
1 change: 1 addition & 0 deletions nf_core/pipeline-template/.yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ extends: default
rules:
document-start: disable
line-length: disable
truthy: disable

0 comments on commit f1143c2

Please sign in to comment.