Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:

- name: Install dependencies
run: |
pip install pre-commit
pip install prek

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should run uv tool install prek instead of pip

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested it for nf-core tools and if you just use one tool, pip is faster inside GHA

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK will merge and ask for forgiveness

curl -s https://get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

Expand Down Expand Up @@ -172,10 +172,10 @@ jobs:
# Create a non-Nextflow file that should be ignored by the hook
echo "print('hello')" > script.py

pre-commit run --all-files
prek run --all-files

# Verify the .py file didn't trigger the hook (it would fail if passed)
echo "Pre-commit correctly filtered non-matching files"
echo "Pre-commit hook correctly filtered non-matching files"

test-no-nextflow:
name: Test Without Nextflow
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A pre-commit hook for running `nextflow lint` on Nextflow pipeline files.
## Installation

- [Nextflow](https://www.nextflow.io/) (v25.04+) installed and available in your `PATH`
- [pre-commit](https://pre-commit.com/) installed
- [prek](https://prek.j178.dev/) installed

## Setup

Expand All @@ -29,7 +29,7 @@ repos:
2. Install the hook:

```bash
pre-commit install
prek install
```

The hook will now run `nextflow lint` on any staged `.nf` and `.config` files when you commit.
Expand Down Expand Up @@ -59,10 +59,10 @@ hooks:

```bash
# Run on all files
pre-commit run nextflow-lint --all-files
prek run nextflow-lint --all-files

# Run on specific files
pre-commit run nextflow-lint --files main.nf
prek run nextflow-lint --files main.nf
```

## Troubleshooting
Expand All @@ -88,9 +88,9 @@ chmod +x nextflow-lint-hook
./nextflow-lint-hook main.nf
./nextflow-lint-hook -format main.nf nextflow.config

# Test with pre-commit
pip install pre-commit
pre-commit run --all-files
# Test with prek
pip install prek
prek run --all-files
```

## License
Expand Down