Add pre-commit hooks for black formatting and spell-checking#3896
Add pre-commit hooks for black formatting and spell-checking#3896bernalde wants to merge 6 commits intoPyomo:mainfrom
Conversation
- Add .pre-commit-config.yaml with black and typos hooks - Update contribution_guide.rst with optional pre-commit setup instructions - Hooks are optional but help catch formatting/spelling issues locally before CI
numpy arrays have a .flags.writeable property, which is not a typo but the correct numpy API naming.
This reverts commit 5fafe0b.
|
@bernalde - We have been discussing this back and forth for a few weeks. Our primary concern about implementing this is that it adds another file that we need to regularly update the config YAML to ensure it is tracking the most recent versions of We propose a compromise - if you'd like, please make a PR that adds only documentation to the Contribution Guide explaining how someone can turn on pre-commit hooks (with a code block of a sample YAML) PLUS a change to the Thanks! |
Fixes #3895
Summary
Adds optional pre-commit hooks to help contributors catch formatting and spelling issues locally before CI.
Changes
.pre-commit-config.yamlwith:blackhook (exclusions matchpyproject.toml)typoshook (uses existing.github/workflows/typos.tomlconfig)contribution_guide.rstwith setup instructionsUsage (Optional)
After setup, hooks run automatically on
git commitfor staged files only.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: