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

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

Issue 2699803005: DevTools: add PRESUBMIT hook for browser_protocol.json in Source/core/inspector (Closed)
Patch Set: Created 3 years, 10 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
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 353e2cdb324e55ea389d14d510ac1d4c5d0c60db..f530999cfe51d9a1214f94d649c95a9ad1dd6cb8 100644
--- a/third_party/WebKit/Source/devtools/PRESUBMIT.py
+++ b/third_party/WebKit/Source/devtools/PRESUBMIT.py
@@ -112,26 +112,14 @@ def _CheckDevtoolsStyle(input_api, output_api):
def _CompileDevtoolsFrontend(input_api, output_api):
- local_paths = [f.LocalPath() for f in input_api.AffectedFiles()]
-
- # FIXME: The compilation does not actually run if injected script-related files
- # have changed, as they reside in core/inspector, which is not affected
- # by this presubmit.
- # Once this is fixed, injected_script_externs.js
- # should be added to the list of triggers.
- devtools_front_end = input_api.os_path.join("devtools", "front_end")
- if (any(devtools_front_end in path for path in local_paths) or any("_protocol.json" in path for path in local_paths) or
- any("compile_frontend.py" in path for path in local_paths) or any("InjectedScriptSource.js" in path
- for path in local_paths) or
- any("DebuggerScript.js" in path for path in local_paths)):
- lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "compile_frontend.py")
- out, _ = input_api.subprocess.Popen(
- [input_api.python_executable, lint_path], stdout=input_api.subprocess.PIPE,
- stderr=input_api.subprocess.STDOUT).communicate()
- if "ERROR" in out or "WARNING" in out:
- return [output_api.PresubmitError(out)]
- if "NOTE" in out:
- return [output_api.PresubmitPromptWarning(out + compile_note)]
+ compile_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "compile_frontend.py")
+ out, _ = input_api.subprocess.Popen(
+ [input_api.python_executable, compile_path], stdout=input_api.subprocess.PIPE,
+ stderr=input_api.subprocess.STDOUT).communicate()
+ if "ERROR" in out or "WARNING" in out:
+ return [output_api.PresubmitError(out)]
+ if "NOTE" in out:
+ return [output_api.PresubmitPromptWarning(out + compile_note)]
return []

Powered by Google App Engine
This is Rietveld 408576698