-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
Setting skip_file_prefixes serves the same purpose as stacklevel, making sure the warning fires in a more informative place. It also actually implicitly sets stack level to at least 2.
When prefixes are supplied, stacklevel is implicitly overridden to be
max(2, stacklevel).
This change was already made upstream PyCQA/flake8-bugbear#497
Sample code:
import os
import warnings
warnings.warn("test", skip_file_prefixes=(os.path.dirname(__file__),))- No explicit
stacklevelkeyword argument found (B028) [Ln 4, Col 1]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingruleImplementing or modifying a lint ruleImplementing or modifying a lint rule