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

MNT: Clean up some style exceptions #27546

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Dec 20, 2023

PR summary

In these cases, a very small percentage of a file really needs an exception, so we can either add a noqa comment, or fix the style issue directly.

In files like pyplot.py, the file-level exception was obscuring that imports like re were unused, or that typing.cast was imported twice.

PR checklist

... instead of using a full file ignore. This allows catching a few more
unused imports.
There's only one or two lines that need this exception, so the entire
file doesn't need to be exempted.
There are really not very many of these to justify exempting the entire
file, and they are easily fixed.
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we‘ve said some time ago, that we don’t want to litter the code with noqa comments, I think it makes sense for some special cases. The alternative of globally applying the exception to a file is too coarse and can hide errors.

@oscargus oscargus merged commit 30ddba9 into matplotlib:main Dec 20, 2023
41 checks passed
@oscargus oscargus added this to the v3.9.0 milestone Dec 20, 2023
@QuLogic QuLogic deleted the explicit-style-exceptions branch December 20, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants