Commit 5c2720e4 authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent 51ee0071
......@@ -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)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment