-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adding an --ignore-missing-type-hints config #10660
Comments
For reference, here's the incomplete idea of what i'm going for in my fork: evinism#1 If it turns out there's no reason this hasn't been implemented, I'll brush it up and submit a PR. |
My first impression is that the overall idea sounds reasonable. We may want to bikeshed some of the details though. I haven't thought about this carefully yet, but here are some random thoughts:
|
Related: #9789 |
@JukkaL Good to know! Forgive me if these questions don't make any sense, i'm very new to this project. First bulletFor (1), to make it more concrete, I take it that what you're proposing is either:
Is this interpretation correct? To nail it down further, as i understand, the user benefit of adding in an error code representation is that we can add inline annotations to ignore it, e.g. I wonder if there's other uses for sub-errors that haven't been explored yet, or what other static analyzers do, etc. Has such a thing been brought up before? Second BulletFor (2), just from a 'least surprising behavior' perspective, i'd imagine that |
Feature
We introduce a new configuration option, namely
--ignore-missing-type-hints
as a lighter alternative to--ignore-missing-imports
. Such a config would be allowed in both the global level and to package-specific configs.The config would simply disable "Skipping analyzing "offending.package": found module but no type hints or library stubs" error messages. More specifically, we'd be disabling errors on
ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS
.Pitch
Having to
ignore-missing-imports
each individual package I import that hasn't built type hints is really frustrating. Several of the notes here for resolving this error are largely non-actionable -- many libraries don't have types associated with them, nor stubs in typeshed.There seem to be a few related issues, for example #4542, #9789 (thanks @hauntsaninja)
Given that a specific ModuleNotFoundReason exists, it makes me wonder why this flag hasn't been implemented yet -- is there a specific technical reason for it?
The text was updated successfully, but these errors were encountered: