Skip to content

Commit

Permalink
Easier plugin debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD authored Nov 18, 2024
1 parent cf1542c commit 5f32bb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/flake8/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ def run_checks(self) -> tuple[str, Results, dict[str, int]]:
row, column = self._extract_syntax_information(e)
self.report(code, row, column, f"{type(e).__name__}: {e.args[0]}")
return self.display_name, self.results, self.statistics
except BaseException as e:
try:
e.add_note(f"while checking {self.filename}")
except AttributeError:
pass # PEP-678 .add_note() method is new in Python 3.11
raise

logical_lines = self.processor.statistics["logical lines"]
self.statistics["logical lines"] = logical_lines
Expand Down

0 comments on commit 5f32bb9

Please sign in to comment.