-
Notifications
You must be signed in to change notification settings - Fork 16
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
BUG - mypy should only be run over our actual code #710
Comments
@greglucas From my understanding, the toml and precommit set up is strange. From what I can find, I don't think it is possible to disable the errors listed in the pre-commit in the toml file. The errors that are allowed to be disabled in the toml are broader more general errors that could include the specific errors in pre-commit, but they would also include other errors that we would want to check. |
It may not be a one-to-one mapping so you might not be able to move all of them (maybe some of them aren't needed anymore even?). But a few of them I think could be moved over.
And then, maybe you can add all of the others to a comma separated list? |
I think I have the errors figured out and excluded from both call types, *I now have the 'mypy .' producing the same error plus other errors, So there is now overlap, but I am still trying to figure out why 'mypy .' is producing more errors. @greglucas Just to clarify, when you say you want it to run over the imap_processing directory, do you mean the repo folder And should this be applied to just the |
Ahh, yes, good call on other locations if we want to check those, mostly I was getting at "it would be nice if it wasn't a blanket I think you could use |
I assume you are talking about the instance where pre-commits are ran and not just the individual mypy check? |
I'm not sure I totally follow the question, so let me know if I'm not addressing the question. I would expect the pre-commit check to run the command |
Ah yes! So I am confident that I can configure the pre-commit hook to run over only the desired directories mentioned above without any extra commands. This would be done in the args section of the hook. |
Description of the issue
Currently, we run mypy in the current working directory:
imap_processing/.pre-commit-config.yaml
Lines 45 to 49 in bf31f33
If someone adds an extra file without type hints like
temp.py
as a testing script, or puts their virtual environment in the current directory then mypy will try to run over those files as well.Steps to reproduce the issue
Create a temporary file or virtual environment without type hints in your local directory, and run
mypy .
and it will fail.Expected behavior (What should happen)
Only run over the project directory
imap_processing/
.Actual behavior (What does happen)
Code Snippet:
Code
Additional notes, affected areas, and suggested fixes
Changing mypy to run only over
imap_processing/
. I also suggest adding the current mypy arguments from the pre-commit hook into thepyproject.toml
configuration file instead. That way anyone could runmypy
and get the proper ignores/additions without needing to add command line arguments.The text was updated successfully, but these errors were encountered: