From 5c2720e46c33f1ec62fd93d3a05dcd99e6171842 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Tue, 9 Jun 2009 14:04:08 +0000 Subject: [PATCH] Make the CheckLongLines() less restrictive in cases where it's hard to enforce. TEST=none BUG=none Review URL: http://codereview.chromium.org/118416 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17937 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index b8cbd94d33..14c5a1b37f 100755 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -98,7 +98,16 @@ def CheckLongLines(input_api, output_api, maxlen=80): """ bad = [] for f, line_num, line in input_api.RightHandSideLines(): - if len(line) > maxlen: + # Allow lines with http://, https:// and #define/#pragma/#include/#if/#endif + # to exceed the maxlen rule. + if (len(line) > maxlen and + not 'http://' in line and + not 'https://' in line and + not line.startswith('#define') and + not line.startswith('#include') and + not line.startswith('#pragma') and + not line.startswith('#if') and + not line.startswith('#endif')): bad.append( '%s, line %s, %s chars' % (f.LocalPath(), line_num, len(line)))