-
Notifications
You must be signed in to change notification settings - Fork 8
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
pre-commit skips strict mypy checks #247
Comments
You sure? I just removed the additional dependencies, ran
...etc |
What I'm saying is that pre-commit doesn't use the pyproject.toml file, so the result you’re seeing makes sense. Look:
but:
|
Right on -- yeah, I'd be happy to mirror our |
Do you know if there's a way to configure mypy in the pre-commit to use the |
I don't see anything, and this SO answer (https://stackoverflow.com/a/74291151/732529) from the pre-commit author doesn't mention anything so my guess might be no. I wonder if using |
See the example config in for cirrus: https://github.com/cirrus-geo/cirrus-geo/blob/main/.pre-commit-config.yaml. I can’t say I configure it perfectly, but the use of the “local” repo tells pre-commit there’s nothing to install, and in effect everything must be system. All the hook configs are then lifted directly, more or less, from each hooks repo, i.e., what would have been installed pulling the hook definition from some repo. I absolutely hate pre-commit as a “package manager” because it is just another place code is getting downloaded and executed on my system. So I ensure all required hooks are installed as part of the dev requirements and configure them as local hooks so it doesn’t do any of that nonsense. It has the added benefit that things like mypy then operate as expected. |
According to the documentation, pre-commit runs mypy with only the
--ignore-missing-imports
flag. So if I'm not wrong thepyproject.toml
file is not being used, which results in thestrict = true
setting in the[tool.mypy]
section being ignored, causing pre-commit to bypass strict checks.The text was updated successfully, but these errors were encountered: