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

Side by Side Diff: third_party/WebKit/Source/core/inspector/PRESUBMIT.py

Issue 2699803005: DevTools: add PRESUBMIT hook for browser_protocol.json in Source/core/inspector (Closed)
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5
6 def _CompileDevtoolsFrontend(input_api, output_api):
7 # Need to get all affected files from change (not just within this subtree)
8 local_paths = [f.LocalPath() for f in input_api.change.AffectedFiles()]
9 devtools = input_api.os_path.join("third_party", "WebKit", "Source", "devtoo ls")
dgozman 2017/02/17 21:38:46 Let's change this to |input_api.PresubmitLocalPath
chenwilliam 2017/02/17 23:51:58 Done.
10
11 # If a devtools file is changed, the PRESUBMIT hook in Source/devtools
12 # will run closure compiler
13 if (any("browser_protocol.json" in path for path in local_paths) and
14 all(devtools not in path for path in local_paths)):
15 compile_path = input_api.os_path.join(
16 input_api.PresubmitLocalPath(), "..", "..", "devtools", "scripts", " compile_frontend.py")
17 out, _ = input_api.subprocess.Popen(
18 [input_api.python_executable, compile_path], stdout=input_api.subpro cess.PIPE,
19 stderr=input_api.subprocess.STDOUT).communicate()
20 if "ERROR" in out or "WARNING" in out:
21 return [output_api.PresubmitError(out)]
22 if "NOTE" in out:
23 return [output_api.PresubmitPromptWarning(out)]
24 return []
25
26
27 def CheckChangeOnUpload(input_api, output_api):
28 results = []
29 results.extend(_CompileDevtoolsFrontend(input_api, output_api))
30 return results
31
32
33 def CheckChangeOnCommit(input_api, output_api):
34 return []
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698