Commit 2d8c977b authored by nednguyen@google.com's avatar nednguyen@google.com

Add file:// case in presubmit_canned_checks.CheckLongLines

BUG=

Review URL: https://codereview.chromium.org/234293002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263142 0039d316-1c4b-4281-b951-d872f2087c98
parent 97a04f20
......@@ -359,7 +359,7 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None):
return False
return (
any((url in line) for url in ('http://', 'https://')) or
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))
......
......@@ -2235,6 +2235,17 @@ class CannedChecksUnittest(PresubmitTestsBase):
None,
presubmit.OutputApi.PresubmitPromptWarning)
def testCannedCheckLongLinesFile(self):
check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z)
self.ContentTest(
check,
' file:// 0 23 5',
None,
' file:// 0 23 56',
None,
presubmit.OutputApi.PresubmitPromptWarning)
def testCannedCheckLongLinesLongSymbol(self):
check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z)
self.ContentTest(
......
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