Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: presubmit_canned_checks.py

Issue 1491633002: Allows python line with pylint: disable=line-too-long to have more than 120 chars (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 7438c8c15ba566ff2f3d837113ee5af1066333c9..7a6f8b57f7e2cb48beda6711656e5c5b72eefe06 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -342,6 +342,11 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None):
if any((url in line) for url in ('file://', 'http://', 'https://')):
return True
+ # If 'line-too-long' is explictly suppressed for the line, any length is
+ # acceptable.
+ if 'pylint: disable=line-too-long' in line and file_extension == 'py':
+ return True
+
if line_len > extra_maxlen:
return False
@@ -351,9 +356,6 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None):
if '<include' in line and file_extension in ('css', 'html', 'js'):
return True
- if 'pylint: disable=line-too-long' in line and file_extension == 'py':
- return True
-
return input_api.re.match(
r'.*[A-Za-z][A-Za-z_0-9]{%d,}.*' % long_symbol, line)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698