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

Side by Side Diff: presubmit_support.py

Issue 2070493002: Expose fnmatch in presubmit's input_api. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 6 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 | tests/presubmit_unittest.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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.8.0' 9 __version__ = '1.8.0'
10 10
11 # TODO(joi) Add caching where appropriate/needed. The API is designed to allow 11 # TODO(joi) Add caching where appropriate/needed. The API is designed to allow
12 # caching (between all different invocations of presubmit scripts for a given 12 # caching (between all different invocations of presubmit scripts for a given
13 # change). We should add it as our presubmit scripts start feeling slow. 13 # change). We should add it as our presubmit scripts start feeling slow.
14 14
15 import cpplint 15 import cpplint
16 import cPickle # Exposed through the API. 16 import cPickle # Exposed through the API.
17 import cStringIO # Exposed through the API. 17 import cStringIO # Exposed through the API.
18 import contextlib 18 import contextlib
19 import fnmatch 19 import fnmatch # Exposed through the API.
20 import glob 20 import glob
21 import inspect 21 import inspect
22 import itertools 22 import itertools
23 import json # Exposed through the API. 23 import json # Exposed through the API.
24 import logging 24 import logging
25 import marshal # Exposed through the API. 25 import marshal # Exposed through the API.
26 import multiprocessing 26 import multiprocessing
27 import optparse 27 import optparse
28 import os # Somewhat exposed through the API. 28 import os # Somewhat exposed through the API.
29 import pickle # Exposed through the API. 29 import pickle # Exposed through the API.
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 self.host_url = 'http://codereview.chromium.org' 341 self.host_url = 'http://codereview.chromium.org'
342 if self.rietveld: 342 if self.rietveld:
343 self.host_url = self.rietveld.url 343 self.host_url = self.rietveld.url
344 344
345 # We expose various modules and functions as attributes of the input_api 345 # We expose various modules and functions as attributes of the input_api
346 # so that presubmit scripts don't have to import them. 346 # so that presubmit scripts don't have to import them.
347 self.basename = os.path.basename 347 self.basename = os.path.basename
348 self.cPickle = cPickle 348 self.cPickle = cPickle
349 self.cpplint = cpplint 349 self.cpplint = cpplint
350 self.cStringIO = cStringIO 350 self.cStringIO = cStringIO
351 self.fnmatch = fnmatch
351 self.glob = glob.glob 352 self.glob = glob.glob
352 self.json = json 353 self.json = json
353 self.logging = logging.getLogger('PRESUBMIT') 354 self.logging = logging.getLogger('PRESUBMIT')
354 self.os_listdir = os.listdir 355 self.os_listdir = os.listdir
355 self.os_walk = os.walk 356 self.os_walk = os.walk
356 self.os_path = os.path 357 self.os_path = os.path
357 self.os_stat = os.stat 358 self.os_stat = os.stat
358 self.pickle = pickle 359 self.pickle = pickle
359 self.marshal = marshal 360 self.marshal = marshal
360 self.re = re 361 self.re = re
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 return 2 1823 return 2
1823 1824
1824 1825
1825 if __name__ == '__main__': 1826 if __name__ == '__main__':
1826 fix_encoding.fix_encoding() 1827 fix_encoding.fix_encoding()
1827 try: 1828 try:
1828 sys.exit(main()) 1829 sys.exit(main())
1829 except KeyboardInterrupt: 1830 except KeyboardInterrupt:
1830 sys.stderr.write('interrupted\n') 1831 sys.stderr.write('interrupted\n')
1831 sys.exit(1) 1832 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698