diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000000..da043ce09c --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,25 @@ +- 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/.*/.*/.*\.nf$ + pass_filenames: true + # args: [] +- id: lint-subworkflows + name: Lint nf-core subworkflows + # description: This hook trims trailing whitespace. + entry: nf-core --hide-progress subworkflows lint + language: python + types: [text] + files: ^subworkflows/.*/.*/.*\.nf$ + pass_filenames: true + # args: [] +- id: lint-pipeline + name: Lint nf-core pipeline + description: Check pipeline code against nf-core guidelines. + entry: nf-core --hide-progress lint + language: python + types: [text] + # args: [] diff --git a/CHANGELOG.md b/CHANGELOG.md index ec033ff1ee..47c8c669fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ - Fix number of arguments for pipelines_create within the command_create function ([#3074](https://github.com/nf-core/tools/pull/3074)) - Update python:3.12-slim Docker digest to 740d94a ([#3079](https://github.com/nf-core/tools/pull/3079)) - Update pre-commit hook pre-commit/mirrors-mypy to v1.11.1 ([#3091](https://github.com/nf-core/tools/pull/3091)) +- 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] diff --git a/nf_core/pipeline-template/.pre-commit-config.yaml b/nf_core/pipeline-template/.pre-commit-config.yaml index 4dc0f1dcd7..bddd336c13 100644 --- a/nf_core/pipeline-template/.pre-commit-config.yaml +++ b/nf_core/pipeline-template/.pre-commit-config.yaml @@ -11,3 +11,7 @@ repos: hooks: - id: editorconfig-checker alias: ec + - repo: https://github.com/nf-core/tools + rev: "2.14.1" + hooks: + - id: lint-pipeline diff --git a/tmp/pytest-of-gitpod/pytest-0/test_github_details0 b/tmp/pytest-of-gitpod/pytest-0/test_github_details0 deleted file mode 160000 index ee82f320cb..0000000000 --- a/tmp/pytest-of-gitpod/pytest-0/test_github_details0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ee82f320cb567b302e7328c1cacab94a98dae787 diff --git a/tmp/pytest-of-gitpod/pytest-0/test_github_exit_message0 b/tmp/pytest-of-gitpod/pytest-0/test_github_exit_message0 deleted file mode 160000 index f7fe48cf9d..0000000000 --- a/tmp/pytest-of-gitpod/pytest-0/test_github_exit_message0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f7fe48cf9d00ab24581686a6d4226d2e9005c607 diff --git a/tmp/pytest-of-gitpod/pytest-0/test_github_question0 b/tmp/pytest-of-gitpod/pytest-0/test_github_question0 deleted file mode 160000 index dce3324acb..0000000000 --- a/tmp/pytest-of-gitpod/pytest-0/test_github_question0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dce3324acbbe32f905afae8553e042f39404b37e diff --git a/tmp/pytest-of-gitpod/pytest-1/test_github_details0 b/tmp/pytest-of-gitpod/pytest-1/test_github_details0 deleted file mode 160000 index e2638dca91..0000000000 --- a/tmp/pytest-of-gitpod/pytest-1/test_github_details0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e2638dca91b137a96b491008b1eeef2bfd791bec diff --git a/tmp/pytest-of-gitpod/pytest-1/test_github_exit_message0 b/tmp/pytest-of-gitpod/pytest-1/test_github_exit_message0 deleted file mode 160000 index 74cda800a8..0000000000 --- a/tmp/pytest-of-gitpod/pytest-1/test_github_exit_message0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 74cda800a86fd07e93bbf8e00e4890516e3d838d diff --git a/tmp/pytest-of-gitpod/pytest-1/test_github_question0 b/tmp/pytest-of-gitpod/pytest-1/test_github_question0 deleted file mode 160000 index 444ebc5370..0000000000 --- a/tmp/pytest-of-gitpod/pytest-1/test_github_question0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 444ebc5370bf91ea808f5d65c5788064f0480045