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

Unified Diff: PRESUBMIT.py

Issue 1686663002: Add presubmit warning about deprecated compiled_resources.gyp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: double down Created 4 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
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f7d2047c8c176cb685acf4a82bd7ca158ff6a13c..45c45370b162cd304dacdb141e4bcf04e7535052 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1545,6 +1545,20 @@ def _CheckSingletonInHeaders(input_api, output_api):
return []
+def _CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api):
+ """Checks for old style compiled_resources.gyp files."""
+ added_files = filter(lambda f: f.Action() == 'A', input_api.AffectedFiles())
+ added_paths = map(lambda f: f.LocalPath(), added_files)
M-A Ruel 2016/02/09 20:27:59 added = [ f.LocalPath() for f in input_api.Affec
Dan Beam 2016/02/09 20:33:25 Done.
+ is_compiled_resource = lambda fp: fp.endswith('compiled_resources.gyp')
+ added_compiled_resources = filter(is_compiled_resource, added_paths)
+
M-A Ruel 2016/02/09 20:27:59 if not added_compiled_resources: return [] is m
Dan Beam 2016/02/09 20:33:25 Done.
+ return [output_api.PresubmitError(
+ "Found new compiled_resources.gyp files:\n%s\n\n"
+ "compiled_resources.gyp files are deprecated,\n"
+ "please use compiled_resources2.gyp instead" %
+ "\n".join(added_compiled_resources))] if added_compiled_resources else []
+
+
_DEPRECATED_CSS = [
# Values
( "-webkit-box", "flex" ),
@@ -1676,6 +1690,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckForCopyrightedCode(input_api, output_api))
results.extend(_CheckForWindowsLineEndings(input_api, output_api))
results.extend(_CheckSingletonInHeaders(input_api, output_api))
+ results.extend(_CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api))
if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698