For instance, ruff rule B028 (no-explicit-stacklevel) is currently on the list so a new pull request could be created to remove it from the list and fix all instances so that this project's nox tests pass.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
% pipx install ruff
% ruff rule B028
no-explicit-stacklevel (B028)
Derived from the flake8-bugbear linter.
What it does
Checks for warnings.warn calls without an explicit stacklevel keyword
argument.
Why is this bad?
The warnings.warn method uses a stacklevel of 1 by default, which
limits the rendered stack trace to that of the line on which the
warn method is called.
It's recommended to use a stacklevel of 2 or higher, give the caller
more context about the warning.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
I an always frustrated when our code quality could be improved.
Describe the solution you'd like A clear and concise description of what you want to happen.
As discussed at https://github.com/goodmami/wn/pull/189#discussion_r1313641276, once #189 has been merged there should be an effort to remove some ruff rules from the
tool.ruff.ignore
ofpyproject.toml
.For instance,
ruff rule B028
(no-explicit-stacklevel) is currently on the list so a new pull request could be created to remove it from the list and fix all instances so that this project'snox
tests pass.Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
%
pipx install ruff
%ruff rule B028
no-explicit-stacklevel (B028)
Derived from the flake8-bugbear linter.
What it does
Checks for
warnings.warn
calls without an explicitstacklevel
keyword argument.Why is this bad?
The
warnings.warn
method uses astacklevel
of 1 by default, which limits the rendered stack trace to that of the line on which thewarn
method is called.It's recommended to use a
stacklevel
of 2 or higher, give the caller more context about the warning.Example
Use instead: