PyCQA / flake8-bugbear

A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
MIT License
1.06k stars 104 forks source link

B005: Do not flag on imported modules #353

Closed FozzieHi closed 1 year ago

FozzieHi commented 1 year ago

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.