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

Unified Diff: utils/run_pylint.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: utils/run_pylint.py
diff --git a/utils/run_pylint.py b/utils/run_pylint.py
index 0bf5f957364faad5dab28745e294a7576bcbc997..3c3e2256c2294f606cd00fb7c2c5d0eb85bfdc54 100755
--- a/utils/run_pylint.py
+++ b/utils/run_pylint.py
@@ -6,10 +6,13 @@ import common
# do a basic check to see if pylint is even installed
try:
import pylint
+ from pylint.__pkginfo__ import version as pylint_version
except ImportError:
print "Unable to import pylint, it may need to be installed"
sys.exit(1)
+major, minor, release = pylint_version.split('.')
+pylint_version = float("%s.%s" % (major, minor))
pylintrc_path = os.path.expanduser('~/.pylintrc')
if not os.path.exists(pylintrc_path):
open(pylintrc_path, 'w').close()
@@ -54,10 +57,13 @@ blacklist = ['/contrib/*', '/frontend/afe/management.py']
# * common_lib.enum.Enum objects
# * DB model objects (scheduler models are the worst, but Django models also
# generate some errors)
-pylint_base_opts = ['--disable-msg-cat=warning,refactor,convention',
- '--disable-msg=E1101,E1103',
- '--reports=no',
- '--include-ids=y']
+if pylint_version >= 0.21:
+ pylint_base_opts = ['--disable=W,R,C,E1101,E1103']
+else:
+ pylint_base_opts = ['--disable-msg-cat=warning,refactor,convention',
+ '--disable-msg=E1101,E1103']
+pylint_base_opts += ['--reports=no',
+ '--include-ids=y']
file_list = sys.argv[1:]
if '--' in file_list:
« cli/job.py ('K') | « utils/external_packages.py ('k') | utils/test_importer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698