-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
support for # type: ignore #164
Comments
I can see this being interesting, and shouldn't be too difficult to explore since
As an aside, it's worth noting that I do not have any influence on this implementation, this is wholly Astral's work and under their editorial control. If you'd like to use the ruff plugin you'll need to request this feature there as well. |
"If you'd like to use the ruff plugin you'll need to request this feature there as well." Understood. I believe that having the new option in flake8-annotations would help in motivating the implementation of an equivalent option in ruff. |
This should be available now to try out. I don't have a large amount of latent code to explore this with so please let me know if there are any issues. |
I tried and it seem to work as expected:). I am still getting some errors in my code base in places mypy does not give me any error. The two type of errors are due to two reasons
|
The first should be easy to add, I'll make another issue to track. For the second, it sounds like you want to ignore |
Description
An option to parse "# type: ignore" comments and disable the flake8-annotations checks on the corresponding lines of code.
Rationale/Use Case
I am currently using mypy to check the type annotations on a large code base, but that is slow to run. I would like to use flake8-annotations (or the ruff re-implementation) before calling mypy in order to be able to catch missing annotation faster than with mypy and thus to be able to iterate faster.
My code contains quite a few "# type: ignore" comments that are currently ignored by flake8-annotations, which gives me many errors when using flake8-annotations while mypy does not raise any error. I would like to have the option to tell flake8-annotations to detect "# type: ignore" comments so that, like mypy, it does not check the corresponding lines and so that I can get flake8-annotations check passing on that code without having to modify the code on each line where I currently use # type: ignore.
The text was updated successfully, but these errors were encountered: