diff options
Diffstat (limited to 'pylint/checkers/format.py')
-rw-r--r-- | pylint/checkers/format.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index d33def5b5..3cb3d5980 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -676,15 +676,11 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): if tokens.type(line_start) != tokenize.STRING: self.check_trailing_whitespace_ending(line, lineno + offset) - # hold onto the initial lineno for later - potential_line_length_warning = False - for offset, line in enumerate(split_lines): - # this check is purposefully simple and doesn't rstrip - # since this is running on every line you're checking it's - # advantageous to avoid doing a lot of work - if len(line) > max_chars: - potential_line_length_warning = True - break + # This check is purposefully simple and doesn't rstrip since this is running + # on every line you're checking it's advantageous to avoid doing a lot of work + potential_line_length_warning = any( + len(line) > max_chars for line in split_lines + ) # if there were no lines passing the max_chars config, we don't bother # running the full line check (as we've met an even more strict condition) |