diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-01-20 18:18:51 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-01-20 18:18:51 +0100 |
commit | bf847d818995245105408153d27bbd49f7486b08 (patch) | |
tree | c4b827c519ad9a90cd409865cb915da445199e78 | |
parent | 4564f6aaf288c36cdaa410f90423a84d80868df0 (diff) | |
download | pylint-git-bf847d818995245105408153d27bbd49f7486b08.tar.gz |
Make the list a generator and continue when there is an error in the fixme lookup
-rw-r--r-- | pylint/checkers/misc.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py index aa1feafaf..6c17918f6 100644 --- a/pylint/checkers/misc.py +++ b/pylint/checkers/misc.py @@ -134,9 +134,9 @@ class EncodingChecker(BaseChecker): """inspect the source to find fixme problems""" if not self.config.notes: return - comments = [ + comments = ( token_info for token_info in tokens if token_info.type == tokenize.COMMENT - ] + ) for comment in comments: comment_text = comment.string[1:].lstrip() # trim '#' and whitespaces @@ -147,14 +147,14 @@ class EncodingChecker(BaseChecker): _, value = disable_option_match.group(1).split("=", 1) values = [_val.strip().upper() for _val in value.split(",")] if set(values) & set(self.config.notes): - return + continue except ValueError: self.add_message( "bad-inline-option", args=disable_option_match.group(1).strip(), line=comment.string, ) - return + continue # emit warnings if necessary for note in self.config.notes: |