OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |