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

Side by Side Diff: pylint.py

Issue 1426683006: Permits running pylint without pylintrc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 1 month 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
« 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 #!/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 """A wrapper script for using pylint from the command line.""" 6 """A wrapper script for using pylint from the command line."""
7 7
8 import os 8 import os
9 import subprocess 9 import subprocess
10 import sys 10 import sys
11 11
12 12
13 _HERE = os.path.dirname(os.path.abspath(__file__)) 13 _HERE = os.path.dirname(os.path.abspath(__file__))
14 _PYLINT = os.path.join(_HERE, 'third_party', 'pylint.py') 14 _PYLINT = os.path.join(_HERE, 'third_party', 'pylint.py')
15 _RC_FILE = os.path.join(_HERE, 'pylintrc') 15 _RC_FILE = os.path.join(_HERE, 'pylintrc')
16 16
17 17
18 # Run pylint. We prepend the command-line with the depot_tools rcfile. If 18 # Run pylint. We prepend the command-line with the depot_tools rcfile. If
19 # another rcfile is to be used, passing --rcfile a second time on the command- 19 # another rcfile is to be used, passing --rcfile a second time on the command-
20 # line will work fine. 20 # line will work fine.
21 command = [sys.executable, _PYLINT, '--rcfile=%s' % _RC_FILE] + sys.argv[1:] 21 command = [sys.executable, _PYLINT]
22 if os.path.isfile(_RC_FILE):
23 # The file can be removed to test 'normal' pylint behavior.
24 command.append('--rcfile=%s' % _RC_FILE)
25 command.extend(sys.argv[1:])
22 try: 26 try:
23 sys.exit(subprocess.call(command)) 27 sys.exit(subprocess.call(command))
24 except KeyboardInterrupt: 28 except KeyboardInterrupt:
25 sys.stderr.write('interrupted\n') 29 sys.stderr.write('interrupted\n')
26 sys.exit(1) 30 sys.exit(1)
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