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

Side by Side Diff: PRESUBMIT.py

Issue 294893003: Blacklist some file for the CSS deprecation hook (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Top-level presubmit script for Chromium. 5 """Top-level presubmit script for Chromium.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl. 8 for more details about the presubmit API built into gcl.
9 """ 9 """
10 10
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 ( "-webkit-gradient", "gradient" ), 1097 ( "-webkit-gradient", "gradient" ),
1098 ( "-webkit-repeating-gradient", "repeating-gradient" ), 1098 ( "-webkit-repeating-gradient", "repeating-gradient" ),
1099 ( "-webkit-linear-gradient", "linear-gradient" ), 1099 ( "-webkit-linear-gradient", "linear-gradient" ),
1100 ( "-webkit-repeating-linear-gradient", "repeating-linear-gradient" ), 1100 ( "-webkit-repeating-linear-gradient", "repeating-linear-gradient" ),
1101 ( "-webkit-radial-gradient", "radial-gradient" ), 1101 ( "-webkit-radial-gradient", "radial-gradient" ),
1102 ( "-webkit-repeating-radial-gradient", "repeating-radial-gradient" ), 1102 ( "-webkit-repeating-radial-gradient", "repeating-radial-gradient" ),
1103 ] 1103 ]
1104 1104
1105 def _CheckNoDeprecatedCSS(input_api, output_api): 1105 def _CheckNoDeprecatedCSS(input_api, output_api):
1106 """ Make sure that we don't use deprecated CSS 1106 """ Make sure that we don't use deprecated CSS
1107 properties, functions or values. """ 1107 properties, functions or values. Our external
1108 documentation is ignored by the hooks as it
1109 needs to be consumed by WebKit. """
1108 results = [] 1110 results = []
1109 file_filter = lambda f: f.LocalPath().endswith('.css') 1111 file_inclusion_pattern = (r".+\.css$")
1112 black_list = (_EXCLUDED_PATHS +
1113 _TEST_CODE_EXCLUDED_PATHS +
1114 input_api.DEFAULT_BLACK_LIST +
1115 (r"^chrome/common/extensions/docs",
1116 r"^chrome/docs",
1117 r"^native_client_sdk"))
1118 file_filter = lambda f: input_api.FilterSourceFile(
1119 f, white_list=file_inclusion_pattern, black_list=black_list)
1110 for fpath in input_api.AffectedFiles(file_filter=file_filter): 1120 for fpath in input_api.AffectedFiles(file_filter=file_filter):
1111 for line_num, line in fpath.ChangedContents(): 1121 for line_num, line in fpath.ChangedContents():
1112 for (deprecated_value, value) in _DEPRECATED_CSS: 1122 for (deprecated_value, value) in _DEPRECATED_CSS:
1113 if input_api.re.search(deprecated_value, line): 1123 if input_api.re.search(deprecated_value, line):
1114 results.append(output_api.PresubmitError( 1124 results.append(output_api.PresubmitError(
1115 "%s:%d: Use of deprecated CSS %s, use %s instead" % 1125 "%s:%d: Use of deprecated CSS %s, use %s instead" %
1116 (fpath.LocalPath(), line_num, deprecated_value, value))) 1126 (fpath.LocalPath(), line_num, deprecated_value, value)))
1117 return results 1127 return results
1118 1128
1119 def _CommonChecks(input_api, output_api): 1129 def _CommonChecks(input_api, output_api):
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 builders.extend(['cros_x86']) 1554 builders.extend(['cros_x86'])
1545 1555
1546 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it 1556 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it
1547 # unless they're .gyp(i) files as changes to those files can break the gyp 1557 # unless they're .gyp(i) files as changes to those files can break the gyp
1548 # step on that bot. 1558 # step on that bot.
1549 if (not all(re.search('^chrome', f) for f in files) or 1559 if (not all(re.search('^chrome', f) for f in files) or
1550 any(re.search('\.gypi?$', f) for f in files)): 1560 any(re.search('\.gypi?$', f) for f in files)):
1551 builders.extend(['android_aosp']) 1561 builders.extend(['android_aosp'])
1552 1562
1553 return GetDefaultTryConfigs(builders) 1563 return GetDefaultTryConfigs(builders)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698