Skip to content

Commit

Permalink
Merge pull request #30 from pR0Ps/patch-1
Browse files Browse the repository at this point in the history
Update references to `loop-invariant-global-usage`
  • Loading branch information
tonybaloney authored May 15, 2022
2 parents 4bf47e0 + f34391d commit 9e246da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions perflint/for_loop_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def visit_augassign(self, node: nodes.AugAssign) -> None:
if isinstance(node.target, nodes.AssignName):
self._loop_assignments[-1].add(node.target.name)

@checker_utils.check_messages("loop-invariant-global-usage")
@checker_utils.check_messages("loop-global-usage")
def visit_name(self, node: nodes.Name) -> None:
"""Look for global names"""
if self._loop_names:
Expand All @@ -321,7 +321,7 @@ def visit_name(self, node: nodes.Name) -> None:
and isinstance(scope.globals[node.name][0], nodes.AssignName)
):
if self._loop_level > 0:
self.add_message("loop-invariant-global-usage", node=node)
self.add_message("loop-global-usage", node=node)

def visit_const(self, node: nodes.Const) -> None:
if self._loop_level == 0:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_loop_invariant.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test(): #@
"""
)

with self.assertAddedMessage("loop-invariant-global-usage"):
with self.assertAddedMessage("loop-global-usage"):
self.walk(test_func)

def test_assigned_global_in_for_loop(self):
Expand Down

0 comments on commit 9e246da

Please sign in to comment.