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

Unified Diff: presubmit_canned_checks.py

Issue 118416: Make the CheckLongLines() less restrictive in cases where it's hard to enforce. (Closed)
Patch Set: Created 11 years, 6 months 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 b8cbd94d33102ae27c9db27b1ed87dce3bb00f35..14c5a1b37f8e00f2ff8f94c14f46d68330b470ab 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
Jói Sigurðsson 2009/06/09 01:39:16 a regexp combining all of these cases would be fas
M-A Ruel 2009/06/09 01:44:37 Yes it's slightly verbose but I thought it was mor
+ 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)))
« 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