From 84033cc110a715e9fa693ad98de5042af7ba6e1b Mon Sep 17 00:00:00 2001 From: "aiolos@chromium.org" Date: Thu, 16 Jul 2015 01:27:15 +0000 Subject: [PATCH] Don't throw "line too long" presubmit error on python import statements or when pylint "line too long" is disabled. BUG= Review URL: https://codereview.chromium.org/1234333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296035 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 620661f38e..5ed86568ff 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -345,11 +345,14 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None): OBJC_FILE_EXTS = ('h', 'm', 'mm') OBJC_EXCEPTIONS = ('#define', '#endif', '#if', '#import', '#include', '#pragma') + PY_FILE_EXTS = ('py') + PY_EXCEPTIONS = ('import', 'from') LANGUAGE_EXCEPTIONS = [ (CPP_FILE_EXTS, CPP_EXCEPTIONS), (JAVA_FILE_EXTS, JAVA_EXCEPTIONS), (OBJC_FILE_EXTS, OBJC_EXCEPTIONS), + (PY_FILE_EXTS, PY_EXCEPTIONS), ] def no_long_lines(file_extension, line): @@ -381,6 +384,9 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None): if '