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

Unified Diff: runtime/PRESUBMIT.py

Issue 2525633002: VM: Enforce correctly formatted C++ code (Closed)
Patch Set: addressed comments Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/PRESUBMIT.py
diff --git a/runtime/PRESUBMIT.py b/runtime/PRESUBMIT.py
index 0170f2f98d67efb2b22f06ea1775c7b328b525f8..44c53dfdeff574dd62c0893748ae7ba999ef370d 100644
--- a/runtime/PRESUBMIT.py
+++ b/runtime/PRESUBMIT.py
@@ -5,6 +5,7 @@
import os
import cpplint
import re
+import StringIO
# memcpy does not handle overlapping memory regions. Even though this
# is well documented it seems to be used in error quite often. To avoid
@@ -49,7 +50,17 @@ def CheckGn(input_api, output_api):
def CheckFormatted(input_api, output_api):
- return input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
+ def convert_warning_to_error(presubmit_result):
+ if not presubmit_result.fatal:
+ # Convert this warning to an error.
+ stream = StringIO.StringIO()
+ presubmit_result.handle(stream)
+ message = stream.getvalue()
+ return output_api.PresubmitError(message)
+ return presubmit_result
+
+ results = input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
+ return [convert_warning_to_error(r) for r in results]
def CheckChangeOnUpload(input_api, output_api):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698