Skip to content
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 # flake8: noqa: F401 #5617

Closed
charliermarsh opened this issue Jul 8, 2023 · 0 comments · Fixed by #5618
Closed

Support # flake8: noqa: F401 #5617

charliermarsh opened this issue Jul 8, 2023 · 0 comments · Fixed by #5618
Labels
suppression Related to supression of violations e.g. noqa

Comments

@charliermarsh
Copy link
Member

Flake8 treats this equivalently to # flake8: noqa -- that is, it turns off all rules for the entire file. As of #5571, we emit a warning but don't respect it at all. I think better would be to just support it in the way the user expects (i.e., turn off F401 for the entire file). It deviates from Flake8, but #5571 deviates from Flake8 too, in a way that's less useful.

@charliermarsh charliermarsh added the suppression Related to supression of violations e.g. noqa label Jul 8, 2023
charliermarsh added a commit that referenced this issue Jul 8, 2023
## Summary

We now treat `# flake8: noqa: F401` as turning off F401 for the entire
file. (Flake8 treats this as turning off _all rules_ for the entire
file).

This deviates from Flake8, but I think it's a much more user-friendly
deviation than what I introduced in #5571. See
#5617 for an explanation.

Closes #5617.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suppression Related to supression of violations e.g. noqa
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant