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

Side by Side Diff: PRESUBMIT.py

Issue 2296783002: Adds new logging type SYSLOG which logs to the system log. (Closed)
Patch Set: Copy/paste error. Created 4 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 | 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 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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