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 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 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2208 fp.close() | 2208 fp.close() |
2209 | 2209 |
2210 if problems: | 2210 if problems: |
2211 return [output_api.PresubmitPromptWarning('Are you sure that you want ' | 2211 return [output_api.PresubmitPromptWarning('Are you sure that you want ' |
2212 'these files to contain Windows style line endings?\n' + | 2212 'these files to contain Windows style line endings?\n' + |
2213 '\n'.join(problems))] | 2213 '\n'.join(problems))] |
2214 | 2214 |
2215 return [] | 2215 return [] |
2216 | 2216 |
2217 | 2217 |
2218 def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None, | |
2219 lint_filters=None, verbose_level=None): | |
2220 """Checks that all source files use SYSLOG properly.""" | |
2221 syslog_files = [] | |
2222 for f in input_api.AffectedSourceFiles(source_file_filter): | |
2223 if 'SYSLOG' in input_api.ReadFile(f, 'rb'): | |
Evan Stade
2017/01/12 01:56:42
is there a particular reason to read the whole fil
pastarmovj
2017/01/12 10:35:21
Problem solved :) https://codereview.chromium.org/
| |
2224 syslog_files.append(f.LocalPath()) | |
2225 if syslog_files: | |
2226 return [output_api.PresubmitPromptWarning( | |
2227 'Please make sure there are no privacy sensitive bits of data in SYSLOG' | |
2228 ' calls.\nFiles to check:\n', items=syslog_files)] | |
2229 return [] | |
2230 | |
2231 | |
2218 def CheckChangeOnUpload(input_api, output_api): | 2232 def CheckChangeOnUpload(input_api, output_api): |
2219 results = [] | 2233 results = [] |
2220 results.extend(_CommonChecks(input_api, output_api)) | 2234 results.extend(_CommonChecks(input_api, output_api)) |
2221 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) | 2235 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) |
2222 results.extend( | 2236 results.extend( |
2223 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) | 2237 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) |
2224 results.extend(_CheckUmaHistogramChanges(input_api, output_api)) | 2238 results.extend(_CheckUmaHistogramChanges(input_api, output_api)) |
2225 results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api)) | 2239 results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api)) |
2240 results.extend(_CheckSyslogUseWarning(input_api, output_api)) | |
2226 return results | 2241 return results |
2227 | 2242 |
2228 | 2243 |
2229 def GetTryServerMasterForBot(bot): | 2244 def GetTryServerMasterForBot(bot): |
2230 """Returns the Try Server master for the given bot. | 2245 """Returns the Try Server master for the given bot. |
2231 | 2246 |
2232 It tries to guess the master from the bot name, but may still fail | 2247 It tries to guess the master from the bot name, but may still fail |
2233 and return None. There is no longer a default master. | 2248 and return None. There is no longer a default master. |
2234 """ | 2249 """ |
2235 # Potentially ambiguous bot names are listed explicitly. | 2250 # Potentially ambiguous bot names are listed explicitly. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2270 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 2285 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
2271 input_api, | 2286 input_api, |
2272 output_api, | 2287 output_api, |
2273 json_url='http://chromium-status.appspot.com/current?format=json')) | 2288 json_url='http://chromium-status.appspot.com/current?format=json')) |
2274 | 2289 |
2275 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2290 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
2276 input_api, output_api)) | 2291 input_api, output_api)) |
2277 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2292 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
2278 input_api, output_api)) | 2293 input_api, output_api)) |
2279 return results | 2294 return results |
OLD | NEW |