Context
Borrowed from IBM/mcp-context-forge which uses .pre-commit-config.yaml with fail_fast: true.
Currently nothing prevents pushing unformatted or broken code. make check is manual.
What to do
- Add
.pre-commit-config.yaml with:
- ruff (lint + format)
- black (formatting)
- Python AST validity check
- Debug statement detection (
breakpoint(), pdb)
- Private key / secrets detection
- YAML/JSON/TOML validation
- Trailing whitespace, end-of-file fixer
- Add
pre-commit to dev dependencies
- Add
make pre-commit-install target
- Document in DEVELOPING.md
Acceptance criteria
pre-commit run --all-files passes
- Hooks auto-run on
git commit
Context
Borrowed from IBM/mcp-context-forge which uses
.pre-commit-config.yamlwithfail_fast: true.Currently nothing prevents pushing unformatted or broken code.
make checkis manual.What to do
.pre-commit-config.yamlwith:breakpoint(),pdb)pre-committo dev dependenciesmake pre-commit-installtargetAcceptance criteria
pre-commit run --all-filespassesgit commit