Skip to content

Commit

Permalink
fix(fixers): count fixed violations correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
guilatrova committed Sep 12, 2021
1 parent ee708a4 commit 825794c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/tryceratops/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def _present_status(self):
else:
print("Nothing to check!")

if self.runner.fixes_made:
print(f"Fixed {self.runner.fixes_made} violations")
if self.runner.fixed_violations:
print(f"Fixed {self.runner.fixed_violations} violations")

if self.discovery.had_issues:
print(
Expand Down
4 changes: 2 additions & 2 deletions src/tryceratops/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):
self.violations: List[Violation] = []
self.analyzed_files = 0
self.excluded_files = 0
self.fixes_made = 0
self.fixed_violations = 0

def _clear(self):
self.violations = []
Expand Down Expand Up @@ -60,7 +60,7 @@ def _run_fixers(self, fixers: Set[BaseFixer]):
logger.exception(f"Exception raised when running Fixer: {type(fixer)}")
self.runtime_errors.append(RuntimeError("unknown", type(fixer), ex))
else:
self.fixes_made += 1
self.fixed_violations += fixer.fixes_made

def analyze(self, trees: ParsedFilesType, global_filter: GlobalFilter) -> List[Violation]:
analyzers = get_analyzer_chain(global_filter)
Expand Down

0 comments on commit 825794c

Please sign in to comment.