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

Extending redefined-outer-name check to cover the case of loop variables #8663

Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift click to select a range
1409f42
Extending redefined-outer-name check to cover the case of loop variables
Lucas-C May 5, 2023
11fa067
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
2f6aef8
Adding documentation
Lucas-C May 5, 2023
a10bad0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
d75a981
Work in progress
Lucas-C May 5, 2023
77a99e2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
8a8d743
Better handling of nodes.Starred
Lucas-C May 5, 2023
22c6679
Work in progress
Lucas-C May 5, 2023
57e7953
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
b3e29b2
Handling tricky case
Lucas-C May 5, 2023
0c71d06
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
3a0e0c5
Fixing edge case
Lucas-C May 5, 2023
567a36c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 5, 2023
1a31d2a
Handling case of variable re-assigned AFTER the for loop
Lucas-C May 6, 2023
41f6d6b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 6, 2023
7feb489
Final fixups (hopefully)
Lucas-C May 9, 2023
6cfbb16
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2023
e83856a
Pleasing pre-commit / pylint
Lucas-C May 9, 2023
a839978
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 9, 2023
c3e5ade
Pleasing mypy
Lucas-C May 9, 2023
30e74e2
Disabling redefined-outer-name for Pylint temporarily as required by …
Lucas-C May 9, 2023
a3092a1
Upgrade astroid to 3.0.0a3
Pierre-Sassoulas May 14, 2023
c831559
Ignore more stdlib classes with complex ancestry
jacobtylerwalls May 14, 2023
11bb684
Add dummy args to empty Dict instantiation
jacobtylerwalls May 14, 2023
75e7954
Merge branch 'upgrade-astroid' into extending-redefined-outer-name-to…
jacobtylerwalls May 15, 2023
ff5488f
Use bleeding-edge astroid
jacobtylerwalls May 15, 2023
cb3f914
[temporary] Skip home-assistant
jacobtylerwalls May 15, 2023
e733253
[primer] Don't cross-reference missing package
jacobtylerwalls May 15, 2023
17aea9f
[temporary] Check out this branch in comment flow
jacobtylerwalls May 15, 2023
3edb200
Revert "Use bleeding-edge astroid"
jacobtylerwalls Jul 6, 2023
41c6d83
Merge branch 'main' into extending-redefined-outer-name-to-loop-varia…
jacobtylerwalls Jul 6, 2023
b2aaaa1
Merge branch 'main' into extending-redefined-outer-name-to-loop-varia…
Pierre-Sassoulas Sep 1, 2023
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
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and Lucas-C committed May 12, 2023
commit 11fa0674e845f8a53799bac6546217a9a157fdab
4 changes: 3 additions & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 1306,9 @@ def visit_for(self, node: nodes.For) -> None:
confidence=HIGH,
)
continue
global_refs = [ref for ref in scope.globals.get(target.name) if ref != target]
global_refs = [
ref for ref in scope.globals.get(target.name) if ref != target
]
if global_refs:
self.add_message(
"redefined-outer-name",
Expand Down