Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow-global-unused-variables should respect dummy-variables-rgx #9570

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/8174.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`--allow-global-unused-variables` respects `--dummy-variables-rgx` now.

Closes #8174
2 changes: 2 additions & 0 deletions pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,8 @@
for node in node_lst:
if in_type_checking_block(node):
continue
if self._is_name_ignored(node_lst, name):
continue

Check warning on line 3197 in pylint/checkers/variables.py

View check run for this annotation

Codecov / codecov/patch

pylint/checkers/variables.py#L3197

Added line #L3197 was not covered by tests
self.add_message("unused-variable", args=(name,), node=node)

# pylint: disable = too-many-branches
Expand Down
Loading