https://github.com/adamrtalbot/nf-lint-pre-commit
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: adamrtalbot
- License: mit
- Language: Shell
- Default Branch: main
- Size: 19.5 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Nextflow Lint Pre-commit Hook
A pre-commit hook for running nextflow lint on Nextflow pipeline files.
What is Nextflow Lint?
nextflow lint is a command provided by Nextflow that checks your pipeline scripts for common issues and best practices. It helps ensure your Nextflow workflows follow proper conventions and can catch potential problems early in development.
Installation
Prerequisites
- Nextflow must be installed and available in your PATH
- pre-commit must be installed
Setup
- Add this hook to your
.pre-commit-config.yamlfile:
yaml
repos:
- repo: https://github.com/adamrtalbot/nf-lint-pre-commit
rev: v0.1.0 # Use the ref you want to point at
hooks:
- id: nextflow-lint
- Install the pre-commit hook:
bash
pre-commit install
Usage
Once installed, the hook will automatically run nextflow lint whenever you commit changes to .nf or .config files in your repository.
Manual Execution
You can also run the hook manually:
```bash
Run on all files
pre-commit run nextflow-lint --all-files
Run on specific files
pre-commit run nextflow-lint --files main.nf ```
Passing Arguments to Nextflow Lint
You can pass any nextflow lint arguments through the hook by adding them to your .pre-commit-config.yaml:
```yaml repos: - repo: https://github.com/adamrtalbot/nf-lint-pre-commit rev: v0.1.0 hooks: - id: nextflow-lint # Basic linting with no arguments (default)
# Or with formatting
- id: nextflow-lint
args: [-format]
# Or with concise output
- id: nextflow-lint
args: [-output, concise]
# Or with multiple options
- id: nextflow-lint
args: [-format, -sort-declarations]
# Or with JSON output for CI systems
- id: nextflow-lint
args: [-output, json]
```
For detailed information about what nextflow lint checks, refer to the Nextflow documentation.
Troubleshooting
Nextflow Not Found
If you get an error that nextflow is not found:
- Make sure Nextflow is installed:
curl -s https://get.nextflow.io | bash - Make sure it's in your PATH:
export PATH="$PATH:/path/to/nextflow" - Verify installation:
nextflow -version
Hook Fails
If the lint check fails:
- Review the output to understand what issues were found
- Fix the issues in your Nextflow files
- Commit again
Skip Hook Temporarily
If you need to skip the hook for a specific commit:
bash
git commit -m "Your commit message" --no-verify
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality in the GitHub Actions workflows
- Ensure all CI tests pass
- Submit a pull request
Development Workflow
Please feel free to contribute to this project by opening an issue or a pull request.
Running Tests Locally
You can test the hook directly during development:
```bash
Install Nextflow (if not already installed)
curl -s https://get.nextflow.io | bash
Test the hook directly
chmod +x nextflow-lint-hook ./nextflow-lint-hook
Test with arguments
./nextflow-lint-hook -format ./nextflow-lint-hook -output concise
Test with pre-commit
pip install pre-commit pre-commit run --all-files ```
License
This project is licensed under the MIT License.
Owner
- Name: Adam Talbot
- Login: adamrtalbot
- Kind: user
- Location: Warwick, UK
- Company: @seqeralabs
- Twitter: adamrtalbot
- Repositories: 48
- Profile: https://github.com/adamrtalbot
Bioinformatics Engineer at @seqeralabs
GitHub Events
Total
- Release event: 1
- Delete event: 1
- Push event: 6
- Create event: 3
Last Year
- Release event: 1
- Delete event: 1
- Push event: 6
- Create event: 3
Dependencies
- actions/checkout v4 composite
- actions/create-release v1 composite
- nf-core/setup-nextflow v2 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- nf-core/setup-nextflow v2 composite