Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pre-commit hooks #3141

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
30 changes: 30 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# TODO https://github.com/nf-core/tools/issues/3140
# - id: lint-modules
# name: Lint nf-core modules
# # description: This hook trims trailing whitespace.
# entry: nf-core --hide-progress modules lint
# language: python
# types: [text]
# files: ^modules/[^/]+$
# pass_filenames: true
# args: []
# NOTE See https://github.com/nf-core/modules/pull/7084 for reasoning
- id: lint-subworkflows
name: Lint nf-core subworkflows
description: Runs linting on all the subworkflows
entry: nf-core --hide-progress subworkflows lint -a
language: python
types: [text]
files: ^subworkflows/[^/]+$
alias: sw
pass_filenames: false
# args: []
- id: lint-pipeline
name: Lint nf-core pipeline
description: Check pipeline code against nf-core guidelines.
entry: nf-core --hide-progress pipelines lint
language: python
types: [text]
pass_filenames: false
stages: [pre-push, manual]
# args: ["--fix"]
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
- Update pre-commit hook pre-commit/mirrors-mypy to v1.11.1 ([#3091](https://github.com/nf-core/tools/pull/3091))
- Update to pytest v8 and move it to dev dependencies ([#3058](https://github.com/nf-core/tools/pull/3058))
- Update minimal textual version and snapshots ([#2998](https://github.com/nf-core/tools/pull/2998))
- Create pre-commit hooks ([#3141](https://github.com/nf-core/tools/pull/3141))

## [v2.14.1 - Tantalum Toad - Patch](https://github.com/nf-core/tools/releases/tag/2.14.1) - [2024-05-09]

Expand Down
4 changes: 4 additions & 0 deletions nf_core/pipeline-template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ repos:
hooks:
- id: editorconfig-checker
alias: ec
- repo: https://github.com/nf-core/tools
rev: "3.1.0"
hooks:
- id: lint-pipeline
Loading