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

Unified Diff: presubmit_canned_checks.py

Issue 424733003: Add exception for long url(..) lines in css files in presubmit_canned_checks.CheckLongLines (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: more review comments Created 6 years, 5 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 | tests/presubmit_unittest.py » ('j') | 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 8be4f52971c6849d2b7122a4d94fb140a0354dd0..011b982e1bff6179ca4442f41987e2c5e379c268 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -358,10 +358,14 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None):
if line_len > extra_maxlen:
return False
- return (
- any((url in line) for url in ('file://', 'http://', 'https://')) or
- input_api.re.match(
- r'.*[A-Za-z][A-Za-z_0-9]{%d,}.*' % long_symbol, line))
+ if any((url in line) for url in ('file://', 'http://', 'https://')):
+ return True
+
+ if 'url(' in line and file_extension == 'css':
+ return True
+
+ return input_api.re.match(
+ r'.*[A-Za-z][A-Za-z_0-9]{%d,}.*' % long_symbol, line)
def format_error(filename, line_num, line):
return '%s, line %s, %s chars' % (filename, line_num, len(line))
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698