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 0dd573f commit 277a27c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pylint/checkers/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,13 @@ def check_line(line, i):
_msg_id.strip() for _msg_id in back_of_equal.split(",")
}:
return None
line = line.rsplit("#", 1)[0].rstrip()

# Find the Pylint comment among all other special comments on the line
_comments = line.rsplit(r'#')
for _msg in _comments:
_msg = _msg.strip()
if _msg.startswith(r'pylint:') and r'disable' in _msg:
line = _msg
break
if len(line) > max_chars and not ignore_long_line.search(line):
self.add_message("line-too-long", line=i, args=(len(line), max_chars))
return i + 1
Expand Down

0 comments on commit 277a27c

Please sign in to comment.