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

Side by Side Diff: PRESUBMIT.py

Issue 1494103004: Set up depot_tools as a recipe package, and add depot_tools recipe module. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years 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 | Annotate | Revision Log
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 depot tools. 5 """Top-level presubmit script for depot tools.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8 details on the presubmit API built into depot_tools. 8 details on the presubmit API built into depot_tools.
9 """ 9 """
10 10
11 import fnmatch 11 import fnmatch
12 import os 12 import os
13 13
14 14
15 def CommonChecks(input_api, output_api, tests_to_black_list): 15 def CommonChecks(input_api, output_api, tests_to_black_list):
16 results = [] 16 results = []
17 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) 17 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api))
18 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ 18 black_list = list(input_api.DEFAULT_BLACK_LIST) + [
19 r'^\.recipe_deps[\/\\].*',
19 r'^cpplint\.py$', 20 r'^cpplint\.py$',
20 r'^cpplint_chromium\.py$', 21 r'^cpplint_chromium\.py$',
21 r'^external_bin[\/\\].+', 22 r'^external_bin[\/\\].+',
22 r'^python[0-9]*_bin[\/\\].+', 23 r'^python[0-9]*_bin[\/\\].+',
24 r'^recipes\.py$',
23 r'^site-packages-py[0-9]\.[0-9][\/\\].+', 25 r'^site-packages-py[0-9]\.[0-9][\/\\].+',
24 r'^svn_bin[\/\\].+', 26 r'^svn_bin[\/\\].+',
25 r'^testing_support[\/\\]_rietveld[\/\\].+'] 27 r'^testing_support[\/\\]_rietveld[\/\\].+']
26 if os.path.exists('.gitignore'): 28 if os.path.exists('.gitignore'):
27 with open('.gitignore') as fh: 29 with open('.gitignore') as fh:
28 lines = [l.strip() for l in fh.readlines()] 30 lines = [l.strip() for l in fh.readlines()]
29 black_list.extend([fnmatch.translate(l) for l in lines if 31 black_list.extend([fnmatch.translate(l) for l in lines if
30 l and not l.startswith('#')]) 32 l and not l.startswith('#')])
31 if os.path.exists('.git/info/exclude'): 33 if os.path.exists('.git/info/exclude'):
32 with open('.git/info/exclude') as fh: 34 with open('.git/info/exclude') as fh:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 123
122 124
123 def CheckChangeOnCommit(input_api, output_api): 125 def CheckChangeOnCommit(input_api, output_api):
124 output = [] 126 output = []
125 output.extend(CommonChecks(input_api, output_api, [])) 127 output.extend(CommonChecks(input_api, output_api, []))
126 output.extend(input_api.canned_checks.CheckDoNotSubmit( 128 output.extend(input_api.canned_checks.CheckDoNotSubmit(
127 input_api, 129 input_api,
128 output_api)) 130 output_api))
129 output.extend(RunGitClTests(input_api, output_api)) 131 output.extend(RunGitClTests(input_api, output_api))
130 return output 132 return output
OLDNEW
« no previous file with comments | « .gitignore ('k') | infra/config/OWNERS » ('j') | infra/config/recipes.cfg » ('J')

Powered by Google App Engine
This is Rietveld 408576698