Commit b5e9607
Fix false positive
When `allow-global-unused-variables` is disabled, global variables whose
names match `dummy-variables-rgx` were still reported as unused (W0612).
This adds a check for the dummy variable regex in `_check_globals`,
consistent with how local variables are already handled.
Closes #10890
Co-Authored-By: Claude Opus 4.6 <[email protected]>unused-variable for globals matching dummy-variables-rgx
1 parent 6ae32db commit b5e9607
5 files changed
Lines changed: 20 additions & 0 deletions
File tree
- doc/whatsnew/fragments
- pylint/checkers
- tests/functional/u/unused
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3286 | 3286 | | |
3287 | 3287 | | |
3288 | 3288 | | |
| 3289 | + | |
| 3290 | + | |
3289 | 3291 | | |
3290 | 3292 | | |
3291 | 3293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments