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

Side by Side Diff: PRESUBMIT.py

Issue 2622083006: Make the SYSLOG presubmit check only check changed lines. (Closed)
Patch Set: Created 3 years, 11 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 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 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 '\n'.join(problems))] 2271 '\n'.join(problems))]
2272 2272
2273 return [] 2273 return []
2274 2274
2275 2275
2276 def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None, 2276 def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None,
2277 lint_filters=None, verbose_level=None): 2277 lint_filters=None, verbose_level=None):
2278 """Checks that all source files use SYSLOG properly.""" 2278 """Checks that all source files use SYSLOG properly."""
2279 syslog_files = [] 2279 syslog_files = []
2280 for f in input_api.AffectedSourceFiles(source_file_filter): 2280 for f in input_api.AffectedSourceFiles(source_file_filter):
2281 if 'SYSLOG' in input_api.ReadFile(f, 'rb'): 2281 for line_number, line in f.ChangedContents():
2282 syslog_files.append(f.LocalPath()) 2282 if 'SYSLOG' in line:
2283 syslog_files.append(f.LocalPath() + ':' + str(line_number))
2284
2283 if syslog_files: 2285 if syslog_files:
2284 return [output_api.PresubmitPromptWarning( 2286 return [output_api.PresubmitPromptWarning(
2285 'Please make sure there are no privacy sensitive bits of data in SYSLOG' 2287 'Please make sure there are no privacy sensitive bits of data in SYSLOG'
2286 ' calls.\nFiles to check:\n', items=syslog_files)] 2288 ' calls.\nFiles to check:\n', items=syslog_files)]
2287 return [] 2289 return []
2288 2290
2289 2291
2290 def CheckChangeOnUpload(input_api, output_api): 2292 def CheckChangeOnUpload(input_api, output_api):
2291 results = [] 2293 results = []
2292 results.extend(_CommonChecks(input_api, output_api)) 2294 results.extend(_CommonChecks(input_api, output_api))
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2343 results.extend(input_api.canned_checks.CheckTreeIsOpen( 2345 results.extend(input_api.canned_checks.CheckTreeIsOpen(
2344 input_api, 2346 input_api,
2345 output_api, 2347 output_api,
2346 json_url='http://chromium-status.appspot.com/current?format=json')) 2348 json_url='http://chromium-status.appspot.com/current?format=json'))
2347 2349
2348 results.extend(input_api.canned_checks.CheckChangeHasBugField( 2350 results.extend(input_api.canned_checks.CheckChangeHasBugField(
2349 input_api, output_api)) 2351 input_api, output_api))
2350 results.extend(input_api.canned_checks.CheckChangeHasDescription( 2352 results.extend(input_api.canned_checks.CheckChangeHasDescription(
2351 input_api, output_api)) 2353 input_api, output_api))
2352 return results 2354 return results
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