mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 21:16:54 +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):
|
||||
style_guide = self.style_guide
|
||||
reported_results_count = 0
|
||||
for (error_code, line_number, column, text, physical_line) in results:
|
||||
reported_results_count += style_guide.handle_error(
|
||||
return sum(
|
||||
style_guide.handle_error(
|
||||
code=error_code,
|
||||
filename=filename,
|
||||
line_number=line_number,
|
||||
|
|
@ -158,7 +157,14 @@ class Manager:
|
|||
text=text,
|
||||
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:
|
||||
"""Check if a path is excluded.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue