From 6df90f329be60cd47b94f17f5a391fdb48842ef3 Mon Sep 17 00:00:00 2001 From: "nednguyen@google.com" Date: Tue, 1 Dec 2015 20:14:33 +0000 Subject: [PATCH] Allows python line with pylint: disable=line-too-long to have more than 120 chars. BUG=564100 Review URL: https://codereview.chromium.org/1491633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297765 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 7438c8c15..7a6f8b57f 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 '