You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, mypy team, I would like to propose a feature that allows users to enable or disable specific error codes in mypy, similar to the functionality available in tools like pylint.
Use Case
Currently, mypy allows for some configuration through the mypy.ini file, such as ignoring missing imports globally or for specific modules, and suppressing individual lines with # type: ignore. However, there is no way to selectively enable or disable specific error codes within the terminal when working on a specific set of errors.
It would be great if I am can have a command such as mypy . --disable=all --enable=untyped-imports and then only see the imports without stubs errors and slowly make my way through those without being overwhelmed by all other errors.
Proposed Solution
To address this, I suggest adding the ability to enable or disable specific error codes via command-line options. This would allow users to focus on specific issues at a time, making it easier to progressively improve the type annotations in a codebase.
This would show only errors related to untyped imports, allowing a developer address errors as they move through a large code base.
Benefits
Granular Control: This feature would give developers more control over the type-checking process, allowing them to focus on specific areas of their code that need attention.
Improved Workflow: By allowing the progressive resolution of type-checking issues, developers can avoid being overwhelmed by large numbers of errors, making mypy easier to integrate into existing projects.
Enhanced Usability: Aligning mypy with tools like pylint in terms of configuration and error handling would make it more intuitive and flexible for developers already familiar with these tools.
Additional Context
This feature could significantly enhance mypy's usability, particularly in large projects where gradually improving type coverage is a priority. It would also facilitate the adoption of mypy in environments where developers may need to focus on specific issues without being distracted by unrelated errors.
Thank you for considering this feature request. I believe it would be a valuable addition to mypy, helping to make Python type checking more manageable for developers.
The text was updated successfully, but these errors were encountered:
Description:
Hello, mypy team, I would like to propose a feature that allows users to enable or disable specific error codes in
mypy
, similar to the functionality available in tools likepylint
.Use Case
Currently,
mypy
allows for some configuration through themypy.ini
file, such as ignoring missing imports globally or for specific modules, and suppressing individual lines with# type: ignore
. However, there is no way to selectively enable or disable specific error codes within the terminal when working on a specific set of errors.It would be great if I am can have a command such as
mypy . --disable=all --enable=untyped-imports
and then only see the imports without stubs errors and slowly make my way through those without being overwhelmed by all other errors.Proposed Solution
To address this, I suggest adding the ability to enable or disable specific error codes via command-line options. This would allow users to focus on specific issues at a time, making it easier to progressively improve the type annotations in a codebase.
For example, a command like this could be used:
mypy . --disable-error-codes=all --enable-error-codes=untyped-import
This would show only errors related to untyped imports, allowing a developer address errors as they move through a large code base.
Benefits
mypy
easier to integrate into existing projects.mypy
with tools likepylint
in terms of configuration and error handling would make it more intuitive and flexible for developers already familiar with these tools.Additional Context
This feature could significantly enhance
mypy
's usability, particularly in large projects where gradually improving type coverage is a priority. It would also facilitate the adoption ofmypy
in environments where developers may need to focus on specific issues without being distracted by unrelated errors.Thank you for considering this feature request. I believe it would be a valuable addition to
mypy
, helping to make Python type checking more manageable for developers.The text was updated successfully, but these errors were encountered: