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

Unified Diff: third_party/WebKit/Source/devtools/PRESUBMIT.py

Issue 2926563004: DevTools: check BUILD.gn file as part of PRESUBMIT (Closed)
Patch Set: fixup Created 3 years, 6 months 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 | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/PRESUBMIT.py
diff --git a/third_party/WebKit/Source/devtools/PRESUBMIT.py b/third_party/WebKit/Source/devtools/PRESUBMIT.py
index 162369251e075a157e1f0363f845c0a68ec16e85..bbd0cf4b07131bb96df4da1857ad9393429227b9 100644
--- a/third_party/WebKit/Source/devtools/PRESUBMIT.py
+++ b/third_party/WebKit/Source/devtools/PRESUBMIT.py
@@ -44,6 +44,26 @@ def _CheckNodeAndNPMModules(input_api, output_api):
return [output_api.PresubmitNotifyResult(out)]
+def _CheckBuildGN(input_api, output_api):
+ original_sys_path = sys.path
+ try:
+ sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts")]
+ import install_node_deps
+ finally:
+ sys.path = original_sys_path
+
+ node_path, _ = install_node_deps.resolve_node_paths()
+
+ script_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "check_gn.js")
+ process = input_api.subprocess.Popen(
+ [node_path, script_path], stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
+ out, _ = process.communicate()
+
+ if process.returncode != 0:
+ return [output_api.PresubmitError(out)]
+ return [output_api.PresubmitNotifyResult(out)]
+
+
def _CheckFormat(input_api, output_api):
def popen(args):
@@ -185,6 +205,7 @@ def _CheckCSSViolations(input_api, output_api):
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CheckNodeAndNPMModules(input_api, output_api))
+ results.extend(_CheckBuildGN(input_api, output_api))
results.extend(_CheckFormat(input_api, output_api))
results.extend(_CheckDevtoolsStyle(input_api, output_api))
results.extend(_CompileDevtoolsFrontend(input_api, output_api))
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698