Default pylint to run using python3
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
This commit is contained in:
parent
7f990ffa16
commit
4c943fbcb2
@ -17,8 +17,6 @@
|
||||
|
||||
"""pylint error checking."""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
@ -61,6 +59,8 @@ class LintOutput(object):
|
||||
@classmethod
|
||||
def from_line(cls, line):
|
||||
m = re.search(r"(\S+):(\d+): \[(\S+)(, \S+)?] (.*)", line)
|
||||
if m is None:
|
||||
return None
|
||||
matched = m.groups()
|
||||
filename, lineno, code, message = (matched[0], int(matched[1]),
|
||||
matched[2], matched[-1])
|
||||
@ -82,7 +82,7 @@ class LintOutput(object):
|
||||
result = {}
|
||||
for line in msg.splitlines():
|
||||
obj = cls.from_line(line)
|
||||
if obj.is_ignored():
|
||||
if obj is None or obj.is_ignored():
|
||||
continue
|
||||
key = obj.key()
|
||||
if key not in result:
|
||||
@ -138,8 +138,10 @@ class ErrorKeys(object):
|
||||
|
||||
def run_pylint():
|
||||
buff = six.StringIO()
|
||||
reporter = text.ParseableTextReporter(output=buff)
|
||||
args = ["--include-ids=y", "-E", "manila"]
|
||||
reporter = text.TextReporter(output=buff)
|
||||
args = [
|
||||
"--msg-template='{path}:{line}: [{msg_id}i({symbol}), {obj}] {msg}'",
|
||||
"-E", "manila"]
|
||||
lint.Run(args, reporter=reporter, exit=False)
|
||||
val = buff.getvalue()
|
||||
buff.close()
|
||||
|
8
tox.ini
8
tox.ini
@ -96,16 +96,16 @@ commands =
|
||||
{toxinidir}/tools/fast8.sh
|
||||
|
||||
[testenv:pylint]
|
||||
basepython = python2.7
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
pylint==0.26.0
|
||||
pylint==1.9.0
|
||||
whitelist_externals = bash
|
||||
commands = bash tools/lintstack.sh
|
||||
|
||||
[testenv:lint]
|
||||
basepython = python2.7
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
pylint==0.26.0
|
||||
pylint==1.9.0
|
||||
commands = python tools/lintstack.py check
|
||||
|
||||
[testenv:api-ref]
|
||||
|
Loading…
Reference in New Issue
Block a user