blob: 168dbec667f2d438768a450305ff5c11098ccf22 [file] [log] [blame]
[email protected]267d6592012-06-19 19:23:311#!/usr/bin/env python
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
4# found in the LICENSE file.
5
6"""A wrapper script for using pylint from the command line."""
7
8import os
9import subprocess
10import sys
11
12
13_HERE = os.path.dirname(os.path.abspath(__file__))
14_PYLINT = os.path.join(_HERE, 'third_party', 'pylint.py')
15_RC_FILE = os.path.join(_HERE, 'pylintrc')
16
17
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-
20# line will work fine.
[email protected]ccbb7462015-11-02 20:46:1521command = [sys.executable, _PYLINT]
22if os.path.isfile(_RC_FILE):
23 # The file can be removed to test 'normal' pylint behavior.
24 command.append('--rcfile=%s' % _RC_FILE)
25command.extend(sys.argv[1:])
[email protected]013731e2015-02-26 18:28:4326try:
27 sys.exit(subprocess.call(command))
28except KeyboardInterrupt:
29 sys.stderr.write('interrupted\n')
30 sys.exit(1)