-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 mirrors-mypy does not report correct error #15634
Comments
I wouldn't go that far. He only said that the mypy hook is simple. My hunch is that it's not When you invoke mypy manually, how exactly you invoke it? (e.g. |
Sorry, it looks like I forgot about the Yes, |
The main difference is that pre-commit only asks mypy to check the files that are in your git tree (it gives mypy a list of specific files), whereas mypy itself given a directory (like .) walks it on its own and makes no exceptions for files not in git. |
Can you use the identity hook (replace mypy temporarily with identity) to see what pre-commit calls mypy with? I'm failing to reproduce your issue locally, but I'm not certain about some details of your setup. (btw, is your |
Sorry I am a bit busy recently, I will try to work on it as soon as I have the time.
I'll try to pack the directory when possible.
No, they are firmly outside of git. |
This may explain the difference in error message ... As |
Hi, sorry for this late update. I encountered a very similar error when running in rebase/cherry-pick. I have made a copy for your reference. Note that this time, deleting https://drive.google.com/drive/folders/11yUV7hDRrovbMv-PHUdg_K_TbJvjByb1?usp=sharing |
I can't see that Google drive link and the pre-commit issue link no longer works. See also #13916 |
Bug Report
(A clear and concise description of what the bug is.)
Mypy complains duplicate module error when
build
directory is not excluded.However, when running mypy with
pre-commit
, the error message is incorrect and misleading.see also: https://github.com/pre-commit/mirrors-mypy/issues/86
@asottile has confirmed it is an error with mypy.
To Reproduce
build
fileNote that only one of my repository has this strange behaviour. Unfortunately, this repo is related to an ongoing manuscript and will not be publicly available until the review stage.
Your Environment
--install-types
I suspect this issue relates to the
--scripts-are-modules
flag, aspre-commit
set is as a default argument.The text was updated successfully, but these errors were encountered: