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

Side by Side Diff: cc/PRESUBMIT.py

Issue 515063004: Better error message in cc PRESUBMIT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | 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 cc. 5 """Top-level presubmit script for cc.
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 errors = [] 134 errors = []
135 135
136 source_file_filter = lambda x: x 136 source_file_filter = lambda x: x
137 for f in input_api.AffectedSourceFiles(source_file_filter): 137 for f in input_api.AffectedSourceFiles(source_file_filter):
138 contents = input_api.ReadFile(f, 'rb') 138 contents = input_api.ReadFile(f, 'rb')
139 if ('FIX'+'ME') in contents: 139 if ('FIX'+'ME') in contents:
140 errors.append(f.LocalPath()) 140 errors.append(f.LocalPath())
141 141
142 if errors: 142 if errors:
143 return [output_api.PresubmitError( 143 return [output_api.PresubmitError(
144 'All TODO comments should be of the form TODO(name).', 144 'All TODO comments should be of the form TODO(name). ' +
145 'Use TODO instead of FIX' + 'ME',
Ian Vollick 2014/08/28 17:37:26 This is amazing.
145 items=errors)] 146 items=errors)]
146 return [] 147 return []
147 148
148 def FindUnquotedQuote(contents, pos): 149 def FindUnquotedQuote(contents, pos):
149 match = re.search(r"(?<!\\)(?P<quote>\")", contents[pos:]) 150 match = re.search(r"(?<!\\)(?P<quote>\")", contents[pos:])
150 return -1 if not match else match.start("quote") + pos 151 return -1 if not match else match.start("quote") + pos
151 152
152 def FindUselessIfdefs(input_api, output_api): 153 def FindUselessIfdefs(input_api, output_api):
153 errors = [] 154 errors = []
154 source_file_filter = lambda x: x 155 source_file_filter = lambda x: x
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return { 296 return {
296 'tryserver.blink': { 297 'tryserver.blink': {
297 'linux_blink_rel': set(['defaulttests']), 298 'linux_blink_rel': set(['defaulttests']),
298 }, 299 },
299 'tryserver.chromium.gpu': { 300 'tryserver.chromium.gpu': {
300 'linux_gpu': set(['defaulttests']), 301 'linux_gpu': set(['defaulttests']),
301 'mac_gpu': set(['defaulttests']), 302 'mac_gpu': set(['defaulttests']),
302 'win_gpu': set(['defaulttests']), 303 'win_gpu': set(['defaulttests']),
303 }, 304 },
304 } 305 }
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