| 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 d2fe54158e9f50cb7ae6ca0165393bea07b6aa2c..ea4a60d450f18ef73c42b8c98e7b91a57f273d24 100644
|
| --- a/third_party/WebKit/Source/devtools/PRESUBMIT.py
|
| +++ b/third_party/WebKit/Source/devtools/PRESUBMIT.py
|
| @@ -36,6 +36,29 @@ import sys
|
|
|
| compile_note = "Be sure to run your patch by the compile_frontend.py script prior to committing!"
|
|
|
| +
|
| +def _CheckDevtoolsStyle(input_api, output_api):
|
| + local_paths = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if f.Action() != "D"]
|
| +
|
| + devtools_root = input_api.PresubmitLocalPath()
|
| + devtools_front_end = input_api.os_path.join(devtools_root, "front_end")
|
| + affected_front_end_files = [file_name for file_name in local_paths if devtools_front_end in file_name and file_name.endswith(".js")]
|
| + affected_front_end_files = [input_api.os_path.relpath(file_name, devtools_root) for file_name in affected_front_end_files]
|
| + if len(affected_front_end_files) > 0:
|
| + lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
|
| + "scripts", "lint_javascript.py")
|
| + process = input_api.subprocess.Popen(
|
| + [input_api.python_executable, lint_path] + affected_front_end_files,
|
| + stdout=input_api.subprocess.PIPE,
|
| + stderr=input_api.subprocess.STDOUT)
|
| + out, _ = process.communicate()
|
| + if process.returncode != 0:
|
| + return [output_api.PresubmitError(out)]
|
| + if "NOTE" in out:
|
| + return [output_api.PresubmitPromptWarning(out)]
|
| + return []
|
| +
|
| +
|
| def _CompileDevtoolsFrontend(input_api, output_api):
|
| local_paths = [f.LocalPath() for f in input_api.AffectedFiles()]
|
|
|
| @@ -129,6 +152,7 @@ def _CheckCSSViolations(input_api, output_api):
|
|
|
| def CheckChangeOnUpload(input_api, output_api):
|
| results = []
|
| + results.extend(_CheckDevtoolsStyle(input_api, output_api))
|
| results.extend(_CompileDevtoolsFrontend(input_api, output_api))
|
| results.extend(_CheckConvertSVGToPNGHashes(input_api, output_api))
|
| results.extend(_CheckOptimizePNGHashes(input_api, output_api))
|
|
|