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

Side by Side Diff: PRESUBMIT.py

Issue 2397443003: Adds new logging type SYSLOG which logs to the system log. (Closed)
Patch Set: Created 4 years, 2 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 | PRESUBMIT_test.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 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 fp.close() 2193 fp.close()
2194 2194
2195 if problems: 2195 if problems:
2196 return [output_api.PresubmitPromptWarning('Are you sure that you want ' 2196 return [output_api.PresubmitPromptWarning('Are you sure that you want '
2197 'these files to contain Windows style line endings?\n' + 2197 'these files to contain Windows style line endings?\n' +
2198 '\n'.join(problems))] 2198 '\n'.join(problems))]
2199 2199
2200 return [] 2200 return []
2201 2201
2202 2202
2203 def _CheckSyslogUseWarning(input_api, output_api, source_file_filter=None,
2204 lint_filters=None, verbose_level=None):
2205 """Checks that all source files use SYSLOG properly."""
2206 syslog_files = []
2207 for f in input_api.AffectedSourceFiles(source_file_filter):
2208 if 'SYSLOG' in input_api.ReadFile(f, 'rb'):
2209 syslog_files.append(f.LocalPath())
2210 if syslog_files:
2211 return [output_api.PresubmitPromptWarning(
2212 'Please make sure there are no privacy sensitive bits of data in SYSLOG'
2213 ' calls.\nFiles to check:\n', items=syslog_files)]
2214 return []
2215
2216
2203 def CheckChangeOnUpload(input_api, output_api): 2217 def CheckChangeOnUpload(input_api, output_api):
2204 results = [] 2218 results = []
2205 results.extend(_CommonChecks(input_api, output_api)) 2219 results.extend(_CommonChecks(input_api, output_api))
2206 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) 2220 results.extend(_CheckValidHostsInDEPS(input_api, output_api))
2207 results.extend( 2221 results.extend(
2208 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) 2222 input_api.canned_checks.CheckGNFormatted(input_api, output_api))
2209 results.extend(_CheckUmaHistogramChanges(input_api, output_api)) 2223 results.extend(_CheckUmaHistogramChanges(input_api, output_api))
2210 results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api)) 2224 results.extend(_AndroidSpecificOnUploadChecks(input_api, output_api))
2225 results.extend(_CheckSyslogUseWarning(input_api, output_api))
2211 return results 2226 return results
2212 2227
2213 2228
2214 def GetTryServerMasterForBot(bot): 2229 def GetTryServerMasterForBot(bot):
2215 """Returns the Try Server master for the given bot. 2230 """Returns the Try Server master for the given bot.
2216 2231
2217 It tries to guess the master from the bot name, but may still fail 2232 It tries to guess the master from the bot name, but may still fail
2218 and return None. There is no longer a default master. 2233 and return None. There is no longer a default master.
2219 """ 2234 """
2220 # Potentially ambiguous bot names are listed explicitly. 2235 # Potentially ambiguous bot names are listed explicitly.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 results.extend(input_api.canned_checks.CheckTreeIsOpen( 2270 results.extend(input_api.canned_checks.CheckTreeIsOpen(
2256 input_api, 2271 input_api,
2257 output_api, 2272 output_api,
2258 json_url='http://chromium-status.appspot.com/current?format=json')) 2273 json_url='http://chromium-status.appspot.com/current?format=json'))
2259 2274
2260 results.extend(input_api.canned_checks.CheckChangeHasBugField( 2275 results.extend(input_api.canned_checks.CheckChangeHasBugField(
2261 input_api, output_api)) 2276 input_api, output_api))
2262 results.extend(input_api.canned_checks.CheckChangeHasDescription( 2277 results.extend(input_api.canned_checks.CheckChangeHasDescription(
2263 input_api, output_api)) 2278 input_api, output_api))
2264 return results 2279 return results
OLDNEW
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698