[codex] Enable docs generation through pre-commit#8
Merged
Conversation
Expose nf-docs as a reusable pre-commit hook so downstream Nextflow pipeline repositories can regenerate documentation before commits. The manifest runs the existing CLI against the repository root and leaves command customization to hook args, which keeps the hook small and aligned with the package entry point. Constraint: pre-commit passes changed filenames by default, but nf-docs operates on a pipeline directory, so the hook disables filename passing. Rejected: Add a second hook wrapper command | unnecessary API surface when nf-docs generate already supports the needed arguments. Confidence: high Scope-risk: narrow Directive: Keep the hook manifest as a thin wrapper around nf-docs generate unless pre-commit users need behavior the CLI cannot express. Tested: pre-commit validate-manifest .pre-commit-hooks.yaml Tested: pre-commit validate-config .pre-commit-config.yaml Tested: pre-commit run --files README.md docs/running.md tests/test_pre_commit_hooks.py .pre-commit-hooks.yaml Tested: pytest Tested: ruff check src/ tests/ Tested: ruff format --check src/ tests/ Tested: ty check src/ Not-tested: End-to-end hook execution inside an external Nextflow pipeline repository
ewels
approved these changes
May 20, 2026
Owner
ewels
left a comment
There was a problem hiding this comment.
Great idea!
Tested locally, works well. I updated the docs slightly to prefer Prek over pre-commit, but no other changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Vibe coded slop before I go on holiday #noragrets
Summary
Adds a reusable
.pre-commit-hooks.yamlentry so downstream Nextflow pipeline repositories can use this repo directly as a pre-commit hook to regenerate nf-docs output.What changed
nf-docspre-commit hook manifest that runsnf-docs generate . --format htmland disables filename passing.ty check src/passes cleanly.Validation
pre-commit validate-manifest .pre-commit-hooks.yamlpre-commit validate-config .pre-commit-config.yamlpre-commit run --files README.md docs/running.md tests/test_pre_commit_hooks.py .pre-commit-hooks.yamlpytestruff check src/ tests/ruff format --check src/ tests/ty check src/Notes
The hook default assumes the consuming repository's pipeline lives at
.and writes HTML docs todocs/. Repositories with a different layout can overrideargsin their.pre-commit-config.yaml.