From 5ab5d85786c0eecb4e6abfd8c579f5de51fef693 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Thu, 25 Apr 2024 09:38:34 -0700 Subject: [PATCH 1/4] allow-global-unused-variables should respect dummy-variables-rgx --- pylint/checkers/variables.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index ebc27c1e33..bbd5ff5cce 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -3193,6 +3193,8 @@ def _check_globals(self, not_consumed: dict[str, nodes.NodeNG]) -> None: for node in node_lst: if in_type_checking_block(node): continue + if self._is_name_ignored(node_lst, name): + continue self.add_message("unused-variable", args=(name,), node=node) # pylint: disable = too-many-branches From 0345d5b1ee21850369ffaaa53087ea5f7f8fb248 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Mon, 29 Apr 2024 08:45:02 -0700 Subject: [PATCH 2/4] add news entry --- doc/whatsnew/fragments/bugfix | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/bugfix diff --git a/doc/whatsnew/fragments/bugfix b/doc/whatsnew/fragments/bugfix new file mode 100644 index 0000000000..b4be1e2dc4 --- /dev/null +++ b/doc/whatsnew/fragments/bugfix @@ -0,0 +1,3 @@ +`--allow-global-unused-variables` respects `--dummy-variables-rgx` now + +Closes #8174 From c3ebd7281bc644b1f2ec28006230b6eae29869a4 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Mon, 29 Apr 2024 09:16:16 -0700 Subject: [PATCH 3/4] add period --- doc/whatsnew/fragments/bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/whatsnew/fragments/bugfix b/doc/whatsnew/fragments/bugfix index b4be1e2dc4..b3580157d7 100644 --- a/doc/whatsnew/fragments/bugfix +++ b/doc/whatsnew/fragments/bugfix @@ -1,3 +1,3 @@ -`--allow-global-unused-variables` respects `--dummy-variables-rgx` now +`--allow-global-unused-variables` respects `--dummy-variables-rgx` now. Closes #8174 From e80d0a513e269ea9447d83797ff993245e2d90c6 Mon Sep 17 00:00:00 2001 From: Jordan Rodgers Date: Mon, 29 Apr 2024 10:00:37 -0700 Subject: [PATCH 4/4] rename bugfix to 8174.bugfix --- doc/whatsnew/fragments/{bugfix => 8174.bugfix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/whatsnew/fragments/{bugfix => 8174.bugfix} (100%) diff --git a/doc/whatsnew/fragments/bugfix b/doc/whatsnew/fragments/8174.bugfix similarity index 100% rename from doc/whatsnew/fragments/bugfix rename to doc/whatsnew/fragments/8174.bugfix