File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1683,6 +1683,8 @@ def check_for_b028(self, node) -> None:
1683
1683
and node .func .value .id == "warnings"
1684
1684
and not any (kw .arg == "stacklevel" for kw in node .keywords )
1685
1685
and len (node .args ) < 3
1686
+ and not any (isinstance (a , ast .Starred ) for a in node .args )
1687
+ and not any (kw .arg is None for kw in node .keywords )
1686
1688
):
1687
1689
self .errors .append (B028 (node .lineno , node .col_offset ))
1688
1690
Original file line number Diff line number Diff line change 11
11
warnings .warn ("test" , DeprecationWarning , stacklevel = 1 )
12
12
warnings .warn ("test" , DeprecationWarning , 1 )
13
13
warnings .warn ("test" , category = DeprecationWarning , stacklevel = 1 )
14
+ args = ("test" , DeprecationWarning , 1 )
15
+ warnings .warn (* args )
16
+ kwargs = {"message" : "test" , "category" : DeprecationWarning , "stacklevel" : 1 }
17
+ warnings .warn (** kwargs )
18
+ warnings .warn (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments