diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-08-24 22:03:35 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-08-24 22:03:35 +0300 |
commit | 6d19e33ba6eb634e22800effe91c110e58cd3852 (patch) | |
tree | 2c5a1355e30853b70759e5dfde8b8148b8783676 /checkers/misc.py | |
parent | e5b8874b8e1075d77528490383794cae13814d5a (diff) | |
download | pylint-git-6d19e33ba6eb634e22800effe91c110e58cd3852.tar.gz |
Other backports from default.
--HG--
branch : pylint-1.3
Diffstat (limited to 'checkers/misc.py')
-rw-r--r-- | checkers/misc.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/checkers/misc.py b/checkers/misc.py index b53f88219..b27b86ae6 100644 --- a/checkers/misc.py +++ b/checkers/misc.py @@ -54,6 +54,17 @@ class EncodingChecker(BaseChecker): 'separated by a comma.')}),) def _check_note(self, notes, lineno, line): + # First, simply check if the notes are in the line at all. This is an + # optimisation to prevent using the regular expression on every line, + # but rather only on lines which may actually contain one of the notes. + # This prevents a pathological problem with lines that are hundreds + # of thousands of characters long. + for note in self.config.notes: + if note in line: + break + else: + return + match = notes.search(line) if not match: return |