Skip to content

B005: Do not flag on imported modules #353

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

Merged
merged 4 commits into from
Feb 16, 2023

Conversation

FozzieHi
Copy link
Contributor

@FozzieHi FozzieHi commented Feb 14, 2023

This PR changes B005 so that it does not flag when the strip() method is used on an imported module such as this:

import test

test.strip("test")

I'm not entirely sure if BugBearVisitor is the correct place to define _b005_imports so please let me know if there's a better place.

This closes #297, but we might want to open a new issue for the configuration of excluded methods, if we want to add that as well.

@FozzieHi FozzieHi changed the title B005 import modules B005: Do not flag on imported modules Feb 14, 2023
@cooperlees cooperlees merged commit 1bf567a into PyCQA:main Feb 16, 2023
@FozzieHi FozzieHi deleted the b005-import-modules branch February 16, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

B005 false positive on methods that happen to be named strip
2 participants