Summary
Add pre-commit hooks configuration to help contributors avoid CI failures from black formatting and typos by catching issues locally before commits.
Motivation
Contributors frequently encounter CI failures due to black formatting or spelling issues. This creates unnecessary iteration cycles and slows down the review process. Pre-commit hooks catch these issues locally before they reach CI.
Proposed Changes
- Add
.pre-commit-config.yaml with black and typos hooks (matching existing CI configuration)
- Update
contribution_guide.rst with optional pre-commit setup instructions
Implementation Notes
- Pre-commit is optional for contributors (not enforced)
- Hook configurations mirror existing CI settings from
pyproject.toml and .github/workflows/typos.toml
- One-time setup:
pip install pre-commit && pre-commit install
- After setup, hooks run automatically on staged files during
git commit
Summary
Add pre-commit hooks configuration to help contributors avoid CI failures from black formatting and typos by catching issues locally before commits.
Motivation
Contributors frequently encounter CI failures due to black formatting or spelling issues. This creates unnecessary iteration cycles and slows down the review process. Pre-commit hooks catch these issues locally before they reach CI.
Proposed Changes
.pre-commit-config.yamlwith black and typos hooks (matching existing CI configuration)contribution_guide.rstwith optional pre-commit setup instructionsImplementation Notes
pyproject.tomland.github/workflows/typos.tomlpip install pre-commit && pre-commit installgit commit