Touch PRESUBMIT.py to run presubmit locally
authorDongwoo Joshua Im <dw.im@samsung.com>
Tue, 7 Jul 2015 07:35:38 +0000 (16:35 +0900)
committerJongsoo Yoon <join.yoon@samsung.com>
Fri, 20 Nov 2015 13:34:09 +0000 (22:34 +0900)
It seems we need to touch some to run presubmit for v8,
including remove ownership/authorship check.
Also, make not print CppLint message which is too big and not really needed.
But, still, we use cpplint-cache.

Reviewed by: Dong-Gwan Kim, anujk sharma, mohan reddy, Kangil Han

Change-Id: I85f4c378b53f1caddf7855ff6b8e4e7e38793d8f
Signed-off-by: Dongwoo Joshua Im <dw.im@samsung.com>
PRESUBMIT.py
tools/presubmit.py

index ab9bba88455906ecb61b6f90cc107b7171f2fc33..3b94ed357001a6238eb71234e4ce4ffb1f678eca 100644 (file)
@@ -80,7 +80,9 @@ def _V8PresubmitChecks(input_api, output_api):
   if not CheckExternalReferenceRegistration(input_api.PresubmitLocalPath()):
     results.append(output_api.PresubmitError(
         "External references registration check failed"))
-  results.extend(CheckAuthorizedAuthor(input_api, output_api))
+#  For internal patches, we should not run Author check.
+#  Hence, commenting this out.
+#  results.extend(CheckAuthorizedAuthor(input_api, output_api))
   return results
 
 
@@ -95,7 +97,8 @@ def _CheckUnwantedDependencies(input_api, output_api):
   original_sys_path = sys.path
   try:
     sys.path = sys.path + [input_api.os_path.join(
-        input_api.PresubmitLocalPath(), 'buildtools', 'checkdeps')]
+#       Adding '..' in the path to run it properly in our local environment.
+        input_api.PresubmitLocalPath(), '..', 'buildtools', 'checkdeps')]
     import checkdeps
     from cpp_checker import CppChecker
     from rules import Rule
@@ -216,8 +219,10 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
 def _CommonChecks(input_api, output_api):
   """Checks common to both upload and commit."""
   results = []
-  results.extend(input_api.canned_checks.CheckOwners(
-      input_api, output_api, source_file_filter=None))
+#  For internal patches, we should not run Owner check.
+#  Hence, commenting this out.
+#  results.extend(input_api.canned_checks.CheckOwners(
+#      input_api, output_api, source_file_filter=None))
   results.extend(input_api.canned_checks.CheckPatchFormatted(
       input_api, output_api))
   results.extend(_V8PresubmitChecks(input_api, output_api))
index 5029450ee74e84bdd4ebffc0bb91d17cf7c18637..35f82cc862b821becdbe6380c1528fa2676513e6 100755 (executable)
@@ -83,7 +83,9 @@ def CppLintWorker(command):
       if m:
         out_lines += out_line
         error_count += 1
-    sys.stdout.write(out_lines)
+#    Too long messages from lint affect to presubmitbot.
+#    Hence, commenting this out.
+#    sys.stdout.write(out_lines)
     return error_count
   except KeyboardInterrupt:
     process.kill()