-
Notifications
You must be signed in to change notification settings - Fork 10
Add mypy as pre-commit hook #26
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
Conversation
update cibuild script ignore errors for now until they can be addressed in code/config options Add note about pre-commit hooks in readme remove python3.8 language_version
f076020
to
3462d45
Compare
mypy output
|
rev: v0.910 | ||
hooks: | ||
- id: mypy | ||
language_version: python |
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.
Can you explain why you decided to move away from the custom hook?
If we keep this approach, ./mypy.sh
will not be required and should be deleted.
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've bumped mypy==v0.910 since it supports configuration in pyproject.toml which I think removes the need for a custom hook
README.md
Outdated
@@ -114,6 +114,9 @@ The following provides information for developers looking to maintain or extend | |||
|
|||
## Architecture | |||
|
|||
## Pre-commit hooks | |||
Git hooks are used to run formatting (isort, black), linting (flake8), and type-checking (mypy). You can install the pre-commit scripts with `pre-commit install`. Thereafter, the scripts defined in `.pre-commit-config.yaml` will be run on the files included in a commit. Specific tool configurations are included in `pyproject.toml`. |
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.
This is useful. Worth mentioning that pre-commit install
is run by scripts/setup
too
@@ -7,15 +7,13 @@ repos: | |||
rev: 21.5b1 | |||
hooks: | |||
- id: black | |||
language_version: python3.8 | |||
language_version: python |
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.
Can you explain this and the related change in pyproject.toml
a bit more?
Would there be a way to specify a minimum version? i.e. 3.8+
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.
specifying python 3.8 here excludes python 3.9 (resulting in error if that is the runtime python version), I'm not sure that we need to enforce a python version here, leaving it to setup.py
or README
thanks @JBurkinshaw! |
Description
Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #5
scripts/cibuild
py38
options from [tool.black] to support pre-commit in py39 venvignore_errors
config until they can be addressedType of change
Please delete options that are not relevant.
Instructions
Explain what someone needs to do in order to test the functionality of the changes.
Run
pre-commit run --all-files
ormypy -p oaff
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: