-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge branch dev/pre-commit-hook #156
base: Develop
Are you sure you want to change the base?
Conversation
The defined configuration is inspired by [flake8] and [black] [flake8]: https://github.com/PyCQA/flake8/blob/main/.pre-commit-config.yaml [black]: https://github.com/psf/black/blob/main/.pre-commit-config.yaml
Add style guide for commit messages Add tool guide to enforce rules
.pre-commit-config.yaml
Outdated
# According to this blog post (https://jaredkhan.com/blog/mypy-pre-commit) | ||
# one should consider running mypy on all files rather than on only the committed changes | ||
# since the changes can break dependencies elsewhere (e.g. function naming) | ||
- repo: https://github.com/pre-commit/mirrors-mypy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Cleaning up the entire repo with mypy is an item on our list. We should enforce mypy in pre-commit hooks only once we've done that.
.pre-commit-config.yaml
Outdated
rev: 22.12.0 | ||
hooks: | ||
- id: black-jupyter # supports .py and .ipynb files | ||
args: [--line-length=79, --target-version=py37] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimal line length is a bitterly contested subject, but I personally find 79 to be too short. I've seen other projects that use 88. I'd much prefer that.
Changes: - line length 79->88 - stop enforcing mypy in pre-commit hooks, until the repo is cleaned using mypy
Add uniform style guide based on conventional commits and AngularJS.
Add optional tools:
Revise pre-commit hook configuration