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

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: maruel@ review 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..e68057563f761eacf9053d63cdadd5b9f5a7e20d 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1545,6 +1545,24 @@ def _CheckSingletonInHeaders(input_api, output_api):
return []
+def _CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api):
+ """Checks for old style compiled_resources.gyp files."""
+ is_compiled_resource = lambda fp: fp.endswith('compiled_resources.gyp')
+
+ added_compiled_resources = filter(is_compiled_resource, [
+ f.LocalPath() for f in input_api.AffectedFiles() if f.Action() == 'A'
+ ])
+
+ if not added_compiled_resources:
+ return []
+
+ 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))]
+
+
_DEPRECATED_CSS = [
# Values
( "-webkit-box", "flex" ),
@@ -1676,6 +1694,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