mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
Easier plugin debugging
This commit is contained in:
parent
cf1542cefa
commit
5f32bb9ab5
1 changed files with 6 additions and 0 deletions
|
|
@ -530,6 +530,12 @@ class FileChecker:
|
||||||
row, column = self._extract_syntax_information(e)
|
row, column = self._extract_syntax_information(e)
|
||||||
self.report(code, row, column, f"{type(e).__name__}: {e.args[0]}")
|
self.report(code, row, column, f"{type(e).__name__}: {e.args[0]}")
|
||||||
return self.display_name, self.results, self.statistics
|
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"]
|
logical_lines = self.processor.statistics["logical lines"]
|
||||||
self.statistics["logical lines"] = logical_lines
|
self.statistics["logical lines"] = logical_lines
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue