Skip to content

Commit

Permalink
PyLint Comments Work With Other Linter Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DevynCJohnson authored Oct 7, 2018
1 parent 277a27c commit 6892c6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pylint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,13 @@ def process_tokens(self, tokens):
match = utils.OPTION_RGX.search(content)
if match is None:
continue

# Find the Pylint comment among all other special comments on the line
_comments = content.rsplit(r'#')
for _msg in _comments:
_msg = _msg.strip()
if _msg.startswith(r'pylint:') and r'disable' in _msg:
content = r'#' + _msg
break
first_group = match.group(1)
if (
first_group.strip() == "disable-all"
Expand Down

0 comments on commit 6892c6e

Please sign in to comment.