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

Side by Side Diff: PRESUBMIT.py

Issue 1237353003: Improve presubmit check for BUG line (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 """Check the env var whether we want to skip tree check. 202 """Check the env var whether we want to skip tree check.
203 Only skip if include/v8-version.h has been updated.""" 203 Only skip if include/v8-version.h has been updated."""
204 src_version = 'include/v8-version.h' 204 src_version = 'include/v8-version.h'
205 FilterFile = lambda file: file.LocalPath() == src_version 205 FilterFile = lambda file: file.LocalPath() == src_version
206 if not input_api.AffectedSourceFiles( 206 if not input_api.AffectedSourceFiles(
207 lambda file: file.LocalPath() == src_version): 207 lambda file: file.LocalPath() == src_version):
208 return False 208 return False
209 return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' 209 return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip'
210 210
211 211
212 def _CheckChangeLogFlag(input_api, output_api): 212 def _CheckChangeLogFlag(input_api, output_api, warn):
213 """Checks usage of LOG= flag in the commit message.""" 213 """Checks usage of LOG= flag in the commit message."""
214 results = [] 214 results = []
215 if input_api.change.BUG and not 'LOG' in input_api.change.tags: 215 if (input_api.change.BUG and input_api.change.BUG != 'none' and
216 results.append(output_api.PresubmitError( 216 not 'LOG' in input_api.change.tags):
217 'An issue reference (BUG=) requires a change log flag (LOG=). ' 217 text = ('An issue reference (BUG=) requires a change log flag (LOG=). '
218 'Use LOG=Y for including this commit message in the change log. ' 218 'Use LOG=Y for including this commit message in the change log. '
219 'Use LOG=N or leave blank otherwise.')) 219 'Use LOG=N or leave blank otherwise.')
220 if warn:
221 results.append(output_api.PresubmitPromptWarning(text))
222 else:
223 results.append(output_api.PresubmitError(text))
220 return results 224 return results
221 225
222 226
223 def CheckChangeOnUpload(input_api, output_api): 227 def CheckChangeOnUpload(input_api, output_api):
224 results = [] 228 results = []
225 results.extend(_CommonChecks(input_api, output_api)) 229 results.extend(_CommonChecks(input_api, output_api))
226 results.extend(_CheckChangeLogFlag(input_api, output_api)) 230 results.extend(_CheckChangeLogFlag(input_api, output_api, True))
227 return results 231 return results
228 232
229 233
230 def CheckChangeOnCommit(input_api, output_api): 234 def CheckChangeOnCommit(input_api, output_api):
231 results = [] 235 results = []
232 results.extend(_CommonChecks(input_api, output_api)) 236 results.extend(_CommonChecks(input_api, output_api))
233 results.extend(_CheckChangeLogFlag(input_api, output_api)) 237 results.extend(_CheckChangeLogFlag(input_api, output_api, False))
Michael Achenbach 2015/07/17 09:55:08 Can you make a test CL with e.g. BUG=foo and see i
234 results.extend(input_api.canned_checks.CheckChangeHasDescription( 238 results.extend(input_api.canned_checks.CheckChangeHasDescription(
235 input_api, output_api)) 239 input_api, output_api))
236 if not _SkipTreeCheck(input_api, output_api): 240 if not _SkipTreeCheck(input_api, output_api):
237 results.extend(input_api.canned_checks.CheckTreeIsOpen( 241 results.extend(input_api.canned_checks.CheckTreeIsOpen(
238 input_api, output_api, 242 input_api, output_api,
239 json_url='http://v8-status.appspot.com/current?format=json')) 243 json_url='http://v8-status.appspot.com/current?format=json'))
240 return results 244 return results
241 245
242 246
243 def GetPreferredTryMasters(project, change): 247 def GetPreferredTryMasters(project, change):
(...skipping 12 matching lines...) Expand all
256 'v8_win64_rel': set(['defaulttests']), 260 'v8_win64_rel': set(['defaulttests']),
257 'v8_mac_rel': set(['defaulttests']), 261 'v8_mac_rel': set(['defaulttests']),
258 'v8_linux_arm_rel': set(['defaulttests']), 262 'v8_linux_arm_rel': set(['defaulttests']),
259 'v8_linux_arm64_rel': set(['defaulttests']), 263 'v8_linux_arm64_rel': set(['defaulttests']),
260 'v8_linux_mipsel_compile_rel': set(['defaulttests']), 264 'v8_linux_mipsel_compile_rel': set(['defaulttests']),
261 'v8_linux_mips64el_compile_rel': set(['defaulttests']), 265 'v8_linux_mips64el_compile_rel': set(['defaulttests']),
262 'v8_android_arm_compile_rel': set(['defaulttests']), 266 'v8_android_arm_compile_rel': set(['defaulttests']),
263 'v8_linux_chromium_gn_rel': set(['defaulttests']), 267 'v8_linux_chromium_gn_rel': set(['defaulttests']),
264 }, 268 },
265 } 269 }
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