Skip to content
Snippets Groups Projects
Commit b6c68505 authored by hippo91's avatar hippo91 Committed by Claudiu Popa
Browse files

Modifying the way results of OPTION_RGX.search(line) are exploited

parent ac7c6d1a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1000,8 +1000,12 @@ class FormatChecker(BaseTokenChecker):
# Don't count excess whitespace in the line length.
line = stripped_line
mobj = OPTION_RGX.search(line)
if mobj and mobj.group(1).split('=', 1)[0].strip() == 'disable':
line = line.split('#')[0].rstrip()
if mobj:
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
line = line.rsplit('#', 1)[0].rstrip()
 
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))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment