Skip to content

Commit

Permalink
Rename reporter to report
Browse files Browse the repository at this point in the history
  • Loading branch information
kreathon committed Sep 3, 2023
1 parent c2580b5 commit 71f2515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions vulture/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def get_list(typ):
self.code = []
self.exit_code = ExitCode.NoDeadCode

reporter = partial(self._define, collection=self.unreachable_code)
self.reachability = Reachability(reporter=reporter)
report = partial(self._define, collection=self.unreachable_code)
self.reachability = Reachability(report=report)

def scan(self, code, filename=""):
filename = Path(filename)
Expand Down
8 changes: 4 additions & 4 deletions vulture/reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


class Reachability:
def __init__(self, reporter):
self.reporter = reporter
def __init__(self, report):
self.report = report
self.no_fall_through_nodes = set()

def reset(self):
Expand Down Expand Up @@ -45,7 +45,7 @@ def _can_fall_through_statements_analysis(self, statements):
next_sibling = None
if next_sibling is not None:
class_name = statement.__class__.__name__.lower()
self.reporter(
self.report(
name=class_name,
first_node=next_sibling,
last_node=statements[-1],
Expand Down Expand Up @@ -89,7 +89,7 @@ def _handle_reachability_try(self, node):

if not try_can_fall_through and has_else:
else_body = node.orelse
self.reporter(
self.report(
name="else",
first_node=else_body[0],
last_node=else_body[-1],
Expand Down

0 comments on commit 71f2515

Please sign in to comment.