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

Side by Side Diff: PRESUBMIT.py

Issue 2898403003: Remove references to GClientKeywords.FromImpl from roll scripts (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | tools/roll_angle.py » ('j') | 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 depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 add_rules.update([ 1133 add_rules.update([
1134 rule[1:] for rule in rules 1134 rule[1:] for rule in rules
1135 if rule.startswith('+') or rule.startswith('!') 1135 if rule.startswith('+') or rule.startswith('!')
1136 ]) 1136 ])
1137 return add_rules 1137 return add_rules
1138 1138
1139 1139
1140 def _ParseDeps(contents): 1140 def _ParseDeps(contents):
1141 """Simple helper for parsing DEPS files.""" 1141 """Simple helper for parsing DEPS files."""
1142 # Stubs for handling special syntax in the root DEPS file. 1142 # Stubs for handling special syntax in the root DEPS file.
1143 def FromImpl(*_):
1144 pass # NOP function so "From" doesn't fail.
1145
1146 def FileImpl(_): 1143 def FileImpl(_):
1147 pass # NOP function so "File" doesn't fail. 1144 pass # NOP function so "File" doesn't fail.
Dirk Pranke 2017/05/24 16:38:47 Nit: you can remove FileImpl(), also.
1148 1145
1149 class _VarImpl: 1146 class _VarImpl:
1150 1147
1151 def __init__(self, local_scope): 1148 def __init__(self, local_scope):
1152 self._local_scope = local_scope 1149 self._local_scope = local_scope
1153 1150
1154 def Lookup(self, var_name): 1151 def Lookup(self, var_name):
1155 """Implements the Var syntax.""" 1152 """Implements the Var syntax."""
1156 try: 1153 try:
1157 return self._local_scope['vars'][var_name] 1154 return self._local_scope['vars'][var_name]
1158 except KeyError: 1155 except KeyError:
1159 raise Exception('Var is not defined: %s' % var_name) 1156 raise Exception('Var is not defined: %s' % var_name)
1160 1157
1161 local_scope = {} 1158 local_scope = {}
1162 global_scope = { 1159 global_scope = {
1163 'File': FileImpl, 1160 'File': FileImpl,
1164 'From': FromImpl,
1165 'Var': _VarImpl(local_scope).Lookup, 1161 'Var': _VarImpl(local_scope).Lookup,
1166 } 1162 }
1167 exec contents in global_scope, local_scope 1163 exec contents in global_scope, local_scope
1168 return local_scope 1164 return local_scope
1169 1165
1170 1166
1171 def _CalculateAddedDeps(os_path, old_contents, new_contents): 1167 def _CalculateAddedDeps(os_path, old_contents, new_contents):
1172 """Helper method for _CheckAddedDepsHaveTargetApprovals. Returns 1168 """Helper method for _CheckAddedDepsHaveTargetApprovals. Returns
1173 a set of DEPS entries that we should look up. 1169 a set of DEPS entries that we should look up.
1174 1170
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 output_api, 2468 output_api,
2473 json_url='http://chromium-status.appspot.com/current?format=json')) 2469 json_url='http://chromium-status.appspot.com/current?format=json'))
2474 2470
2475 results.extend( 2471 results.extend(
2476 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) 2472 input_api.canned_checks.CheckPatchFormatted(input_api, output_api))
2477 results.extend(input_api.canned_checks.CheckChangeHasBugField( 2473 results.extend(input_api.canned_checks.CheckChangeHasBugField(
2478 input_api, output_api)) 2474 input_api, output_api))
2479 results.extend(input_api.canned_checks.CheckChangeHasDescription( 2475 results.extend(input_api.canned_checks.CheckChangeHasDescription(
2480 input_api, output_api)) 2476 input_api, output_api))
2481 return results 2477 return results
OLDNEW
« no previous file with comments | « no previous file | tools/roll_angle.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698