---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B028 [*] No explicit `stacklevel` keyword argument found
  --> B028.py:8:1
   |
 6 | """
 7 |
 8 | warnings.warn("test", DeprecationWarning)
   | ^^^^^^^^^^^^^
 9 | warnings.warn("test", DeprecationWarning, source=None)
10 | warnings.warn("test", DeprecationWarning, source=None, stacklevel=2)
   |
help: Set `stacklevel=2`
  |
7 |
  - warnings.warn("test", DeprecationWarning)
8 + warnings.warn("test", DeprecationWarning, stacklevel=2)
9 | warnings.warn("test", DeprecationWarning, source=None)
  |
note: This is an unsafe fix and may change runtime behavior

B028 [*] No explicit `stacklevel` keyword argument found
  --> B028.py:9:1
   |
 8 | warnings.warn("test", DeprecationWarning)
 9 | warnings.warn("test", DeprecationWarning, source=None)
   | ^^^^^^^^^^^^^
10 | warnings.warn("test", DeprecationWarning, source=None, stacklevel=2)
11 | warnings.warn("test", DeprecationWarning, stacklevel=1)
   |
help: Set `stacklevel=2`
   |
8  | warnings.warn("test", DeprecationWarning)
   - warnings.warn("test", DeprecationWarning, source=None)
9  + warnings.warn("test", DeprecationWarning, stacklevel=2, source=None)
10 | warnings.warn("test", DeprecationWarning, source=None, stacklevel=2)
   |
note: This is an unsafe fix and may change runtime behavior

B028 [*] No explicit `stacklevel` keyword argument found
  --> B028.py:22:1
   |
20 | warnings.warn(*args, **kwargs)
21 |
22 | warnings.warn(
   | ^^^^^^^^^^^^^
23 |         "test",
24 |         DeprecationWarning,
   |
help: Set `stacklevel=2`
   |
25 |         # some comments here
   -         source = None # no trailing comma
26 +         stacklevel=2, source = None # no trailing comma
27 |     )
   |
note: This is an unsafe fix and may change runtime behavior

B028 [*] No explicit `stacklevel` keyword argument found
  --> B028.py:32:1
   |
30 | warnings.warn("test", skip_file_prefixes=(os.path.dirname(__file__),))
31 | # trigger diagnostic if `skip_file_prefixes` is present and set to the default value
32 | warnings.warn("test", skip_file_prefixes=())
   | ^^^^^^^^^^^^^
33 |
34 | _my_prefixes = ("this","that")
   |
help: Set `stacklevel=2`
   |
31 | # trigger diagnostic if `skip_file_prefixes` is present and set to the default value
   - warnings.warn("test", skip_file_prefixes=())
32 + warnings.warn("test", stacklevel=2, skip_file_prefixes=())
33 |
   |
note: This is an unsafe fix and may change runtime behavior
