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
changes/01/332501/1
nednguyen@google.com 12 years ago
parent 97a04f2055
commit 2d8c977b8e

@ -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(

Loading…
Cancel
Save