summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2017-11-19 15:28:40 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2017-12-11 11:43:40 +0100
commitadd610ce2d4798c823c8e4b40576ce0b5bab073e (patch)
tree64069bb013bcae98a10eac76c3c33b9a8c7be3bd
parent908c29972c30f4c1c6b3116189fb0b74a9172bcd (diff)
downloadpylint-git-add610ce2d4798c823c8e4b40576ce0b5bab073e.tar.gz
Add of a test on the presence of = in the line. Return None instead of Return to avoid inconsistent return statement
-rw-r--r--pylint/checkers/format.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py
index 1ea56ac1f..097eb6aee 100644
--- a/pylint/checkers/format.py
+++ b/pylint/checkers/format.py
@@ -1000,11 +1000,11 @@ class FormatChecker(BaseTokenChecker):
# Don't count excess whitespace in the line length.
line = stripped_line
mobj = OPTION_RGX.search(line)
- if mobj:
+ if mobj and '=' in line:
front_of_equal, back_of_equal = mobj.group(1).split('=', 1)
if front_of_equal.strip() == 'disable':
if 'line-too-long' in [_msg_id.strip() for _msg_id in back_of_equal.split(',')]:
- return
+ return None
line = line.rsplit('#', 1)[0].rstrip()
if len(line) > max_chars and not ignore_long_line.search(line):