| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # This program is free software; you can redistribute it and/or modify it under | 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 | 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 | 4 # Foundation; either version 2 of the License, or (at your option) any later |
| 5 # version. | 5 # version. |
| 6 # | 6 # |
| 7 # This program is distributed in the hope that it will be useful, but WITHOUT | 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 | 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 | 9 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details |
| 10 # | 10 # |
| 11 # You should have received a copy of the GNU General Public License along with | 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., | 12 # this program; if not, write to the Free Software Foundation, Inc., |
| 13 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 13 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 14 """ Copyright (c) 2002-2008 LOGILAB S.A. (Paris, FRANCE). | 14 """ Copyright (c) 2002-2008 LOGILAB S.A. (Paris, FRANCE). |
| 15 http://www.logilab.fr/ -- mailto:contact@logilab.fr | 15 http://www.logilab.fr/ -- mailto:contact@logilab.fr |
| 16 | 16 |
| 17 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 17 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 18 """ | 18 """ |
| 19 import os | |
| 20 import sys | 19 import sys |
| 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 | |
| 26 from pylint import lint | 20 from pylint import lint |
| 27 | 21 |
| 28 args = sys.argv[1:] | 22 args = sys.argv[1:] |
| 29 | 23 |
| 30 # Add support for a custom mode where arguments are fed line by line on | 24 # 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. | 25 # stdin. This allows us to get around command line length limitations. |
| 32 ARGS_ON_STDIN = '--args-on-stdin' | 26 ARGS_ON_STDIN = '--args-on-stdin' |
| 33 if ARGS_ON_STDIN in args: | 27 if ARGS_ON_STDIN in args: |
| 34 args = [arg for arg in args if arg != ARGS_ON_STDIN] | 28 args = [arg for arg in args if arg != ARGS_ON_STDIN] |
| 35 args.extend(arg.strip() for arg in sys.stdin) | 29 args.extend(arg.strip() for arg in sys.stdin) |
| 36 | 30 |
| 37 lint.Run(args) | 31 lint.Run(args) |
| OLD | NEW |