-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Reading mypy.ini or setup.cfg in parent directories. #3377
Comments
I'm not sure whether mypy would work from those subdirectories because of how imports are resolved. Based on my experience it's better to typecheck the project as a whole, with current directory set to top project directory. |
I considered this when I first implemented the config file, but I don't think that is a good idea. Most projects don't have a mypy.ini or setup.cfg file and I don't want some file by that name in e.g. my home directory to affect mypy's behavior in all subdirectories. It's easy to forget that that file exists and easy to be confused by some of the many flags that could be present in such a file. |
This is frustrating me currently. One use case for this is using mypy in an IDE to type check while coding. In order to get it working, you'd have to do something like symlink your mypy.ini files to all directories. I don't understand your concern about a mypy.ini in your home directory. It seems to me that this is essentially the same as the one in your |
Please consider revisiting this decision in light of the Python Packaging Authority switching to the |
I have a folder structure like this:
I'm also using flycheck/mypy to check my files in emacs, however, it only read mypy.ini from current folder,
which is the file that I'm visiting.
I'm wondering if we can let mypy read config file from current folder, parent folder, grandparent folder etc until it find one. This is the same way of git looking for .gitignore, and nodejs looking for node_modules.
If you think it's a good idea, I might be able to write the code and make a PR.
Regards.
The text was updated successfully, but these errors were encountered: