From 0ecad9c05d257e78ba8422bb75d896ba4fbc53c5 Mon Sep 17 00:00:00 2001 From: "torne@chromium.org" Date: Fri, 15 Feb 2013 16:35:16 +0000 Subject: [PATCH] Presubmit tests: allow 200 columns in .mk files. The Android WebView code includes several manually-maintained .mk files that are included by the Android build system. These contain some fairly long lines as they need to refer to deep pathnames, which means the CQ cannot be used as it always triggers a presubmit warning. Allow .mk files to have 200 columns per line instead, which should be enough for the long paths that are used. Add a test case for this. BUG= Review URL: https://chromiumcodereview.appspot.com/12252067 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@182733 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 2 ++ tests/presubmit_unittest.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 5516ca3aa..995aa4550 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -318,6 +318,8 @@ def CheckLongLines(input_api, output_api, maxlen=80, source_file_filter=None): """ maxlens = { 'java': 100, + # This is specifically for Android's handwritten makefiles (Android.mk). + 'mk': 200, '': maxlen, } # Note: these are C++ specific but processed on all languages. :( diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 3a934ea71..7e7c170e2 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -1834,6 +1834,11 @@ class CannedChecksUnittest(PresubmitTestsBase): 'importSomething ' + 'A ' * 50, 'foo.java', presubmit.OutputApi.PresubmitPromptWarning) + def testCannedCheckMakefileLongLines(self): + check = lambda x, y, _: presubmit_canned_checks.CheckLongLines(x, y) + self.ContentTest(check, 'A ' * 100, 'foo.mk', 'A ' * 100 + 'B', 'foo.mk', + presubmit.OutputApi.PresubmitPromptWarning) + def testCannedCheckLongLinesLF(self): check = lambda x, y, z: presubmit_canned_checks.CheckLongLines(x, y, 10, z) self.ContentTest(check, '012345678\n', None, '0123456789\n', None,