mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 15:24:18 +00:00
Replace for loop with sum()
This commit is contained in:
parent
9e550df7a0
commit
36cb66c072
1 changed files with 10 additions and 4 deletions
|
|
@ -148,9 +148,8 @@ class Manager:
|
||||||
|
|
||||||
def _handle_results(self, filename, results):
|
def _handle_results(self, filename, results):
|
||||||
style_guide = self.style_guide
|
style_guide = self.style_guide
|
||||||
reported_results_count = 0
|
return sum(
|
||||||
for (error_code, line_number, column, text, physical_line) in results:
|
style_guide.handle_error(
|
||||||
reported_results_count += style_guide.handle_error(
|
|
||||||
code=error_code,
|
code=error_code,
|
||||||
filename=filename,
|
filename=filename,
|
||||||
line_number=line_number,
|
line_number=line_number,
|
||||||
|
|
@ -158,7 +157,14 @@ class Manager:
|
||||||
text=text,
|
text=text,
|
||||||
physical_line=physical_line,
|
physical_line=physical_line,
|
||||||
)
|
)
|
||||||
return reported_results_count
|
for (
|
||||||
|
error_code,
|
||||||
|
line_number,
|
||||||
|
column,
|
||||||
|
text,
|
||||||
|
physical_line,
|
||||||
|
) in results
|
||||||
|
)
|
||||||
|
|
||||||
def is_path_excluded(self, path: str) -> bool:
|
def is_path_excluded(self, path: str) -> bool:
|
||||||
"""Check if a path is excluded.
|
"""Check if a path is excluded.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue