[email protected] | 267d659 | 2012-06-19 19:23:31 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # This program is free software; you can redistribute it and/or modify it under |
| 3 | # the terms of the GNU General Public License as published by the Free Software |
| 4 | # Foundation; either version 2 of the License, or (at your option) any later |
| 5 | # version. |
| 6 | # |
| 7 | # This program is distributed in the hope that it will be useful, but WITHOUT |
| 8 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 9 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details |
| 10 | # |
| 11 | # You should have received a copy of the GNU General Public License along with |
| 12 | # this program; if not, write to the Free Software Foundation, Inc., |
| 13 | # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 14 | """ Copyright (c) 2002-2008 LOGILAB S.A. (Paris, FRANCE). |
| 15 | http://www.logilab.fr/ -- mailto:[email protected] |
[email protected] | 1b129e5 | 2012-06-22 17:08:11 | [diff] [blame] | 16 | |
| 17 | Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 267d659 | 2012-06-19 19:23:31 | [diff] [blame] | 18 | """ |
[email protected] | e3b32af | 2014-11-20 22:41:07 | [diff] [blame] | 19 | import os |
[email protected] | 267d659 | 2012-06-19 19:23:31 | [diff] [blame] | 20 | import sys |
[email protected] | e3b32af | 2014-11-20 22:41:07 | [diff] [blame] | 21 | |
| 22 | # Add local modules to the search path. |
| 23 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath( |
| 24 | __file__)), 'logilab')) |
| 25 | |
[email protected] | 267d659 | 2012-06-19 19:23:31 | [diff] [blame] | 26 | from pylint import lint |
[email protected] | 1b129e5 | 2012-06-22 17:08:11 | [diff] [blame] | 27 | |
| 28 | args = sys.argv[1:] |
| 29 | |
| 30 | # Add support for a custom mode where arguments are fed line by line on |
| 31 | # stdin. This allows us to get around command line length limitations. |
| 32 | ARGS_ON_STDIN = '--args-on-stdin' |
| 33 | if ARGS_ON_STDIN in args: |
| 34 | args = [arg for arg in args if arg != ARGS_ON_STDIN] |
| 35 | args.extend(arg.strip() for arg in sys.stdin) |
| 36 | |
| 37 | lint.Run(args) |