summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2018-06-06 13:54:18 -0500
committerSean McGinnis <sean.mcginnis@gmail.com>2018-06-06 16:14:22 -0500
commit4c943fbcb25f4d4f8e2e9d8b77f0e389bed13c8b (patch)
tree1b7f46d31313d428e63aa69eaeafab36251ea2ea
parent7f990ffa16117769f7616779dd94f81c8d676511 (diff)
Default pylint to run using python37.0.0.0b2
Updates the pylint and lint jobs to run under python3 by changing the target python and updating the version of pylint used. Change-Id: Ie0ac158674fb22054b80864d33d9d7ecc82e3b36 Closes-bug: #1673824
Notes
Notes (review): Code-Review+2: Tom Barron <tpb@dyncloud.net> Code-Review+2: Goutham Pacha Ravi <gouthampravi@gmail.com> Code-Review+2: zhongjun <jun.zhongjun2@gmail.com> Workflow+1: zhongjun <jun.zhongjun2@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 07 Jun 2018 01:41:54 +0000 Reviewed-on: https://review.openstack.org/572991 Project: openstack/manila Branch: refs/heads/master
-rwxr-xr-xtools/lintstack.py12
-rw-r--r--tox.ini8
2 files changed, 11 insertions, 9 deletions
diff --git a/tools/lintstack.py b/tools/lintstack.py
index da0a6b9..89d9e94 100755
--- a/tools/lintstack.py
+++ b/tools/lintstack.py
@@ -17,8 +17,6 @@
17 17
18"""pylint error checking.""" 18"""pylint error checking."""
19 19
20from __future__ import print_function
21
22import json 20import json
23import re 21import re
24import sys 22import sys
@@ -61,6 +59,8 @@ class LintOutput(object):
61 @classmethod 59 @classmethod
62 def from_line(cls, line): 60 def from_line(cls, line):
63 m = re.search(r"(\S+):(\d+): \[(\S+)(, \S+)?] (.*)", line) 61 m = re.search(r"(\S+):(\d+): \[(\S+)(, \S+)?] (.*)", line)
62 if m is None:
63 return None
64 matched = m.groups() 64 matched = m.groups()
65 filename, lineno, code, message = (matched[0], int(matched[1]), 65 filename, lineno, code, message = (matched[0], int(matched[1]),
66 matched[2], matched[-1]) 66 matched[2], matched[-1])
@@ -82,7 +82,7 @@ class LintOutput(object):
82 result = {} 82 result = {}
83 for line in msg.splitlines(): 83 for line in msg.splitlines():
84 obj = cls.from_line(line) 84 obj = cls.from_line(line)
85 if obj.is_ignored(): 85 if obj is None or obj.is_ignored():
86 continue 86 continue
87 key = obj.key() 87 key = obj.key()
88 if key not in result: 88 if key not in result:
@@ -138,8 +138,10 @@ class ErrorKeys(object):
138 138
139def run_pylint(): 139def run_pylint():
140 buff = six.StringIO() 140 buff = six.StringIO()
141 reporter = text.ParseableTextReporter(output=buff) 141 reporter = text.TextReporter(output=buff)
142 args = ["--include-ids=y", "-E", "manila"] 142 args = [
143 "--msg-template='{path}:{line}: [{msg_id}i({symbol}), {obj}] {msg}'",
144 "-E", "manila"]
143 lint.Run(args, reporter=reporter, exit=False) 145 lint.Run(args, reporter=reporter, exit=False)
144 val = buff.getvalue() 146 val = buff.getvalue()
145 buff.close() 147 buff.close()
diff --git a/tox.ini b/tox.ini
index f86a0be..ae99cc3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -96,16 +96,16 @@ commands =
96 {toxinidir}/tools/fast8.sh 96 {toxinidir}/tools/fast8.sh
97 97
98[testenv:pylint] 98[testenv:pylint]
99basepython = python2.7 99basepython = python3
100deps = -r{toxinidir}/requirements.txt 100deps = -r{toxinidir}/requirements.txt
101 pylint==0.26.0 101 pylint==1.9.0
102whitelist_externals = bash 102whitelist_externals = bash
103commands = bash tools/lintstack.sh 103commands = bash tools/lintstack.sh
104 104
105[testenv:lint] 105[testenv:lint]
106basepython = python2.7 106basepython = python3
107deps = -r{toxinidir}/requirements.txt 107deps = -r{toxinidir}/requirements.txt
108 pylint==0.26.0 108 pylint==1.9.0
109commands = python tools/lintstack.py check 109commands = python tools/lintstack.py check
110 110
111[testenv:api-ref] 111[testenv:api-ref]