summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAmrith Kumar <amrith@tesora.com>2016-12-16 07:33:53 -0500
committerAmrith Kumar <amrith@tesora.com>2016-12-18 08:18:47 -0500
commit6d1349eb8bfcf7fb649a791f003c5bf23d356003 (patch)
treef5c64727e205c040b70be26701075dc8cc1219e7 /tools
parent8adfb7e4f27fb9daf87dda018094cc6c58089b88 (diff)
downloadtrove-6d1349eb8bfcf7fb649a791f003c5bf23d356003.tar.gz
trove pylint cleanup(s)
This commit includes two cleanups in trove-pylint. First, the deprecation warning is because the text.ParseableOutputFormat is being deprecated[1] and produces a deprecation warning as shown in the bug. Second, while looking into 1650816, I stumbled upon 1650888 which is also fixed. A block of code was wrongly indented and when I disabled "-E" to generate warnings, produced a crash in pylint. If the line generated doesn't match the regular expression, the various parameters to the next call (to ignore()) are not set and you get unbound variable errors. [1] https://github.com/PyCQA/pylint/blob/master/pylint/reporters/text.py#L163 Change-Id: I43bd6569a98eeb1b326e4a0ca1addaf97c0830a5 Closes-Bug: #1650530 Closes-But: #1650888
Diffstat (limited to 'tools')
-rwxr-xr-xtools/trove-pylint.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/trove-pylint.py b/tools/trove-pylint.py
index a31d9db9..785c4bf6 100755
--- a/tools/trove-pylint.py
+++ b/tools/trove-pylint.py
@@ -194,6 +194,13 @@ def usage():
print("\t rebuild: rebuild the list of exceptions to ignore.")
return 0
+class ParseableTextReporter(text.TextReporter):
+ name = 'parseable'
+ line_format = '{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
+
+ # that's it folks
+
+
class LintRunner(object):
def __init__(self):
self.config = Config()
@@ -204,7 +211,7 @@ class LintRunner(object):
exceptions = set()
buffer = csio()
- reporter = text.ParseableTextReporter(output=buffer)
+ reporter = ParseableTextReporter(output=buffer)
options = list(self.config.get('options'))
options.append(filename)
lint.Run(options, reporter=reporter, exit=False)
@@ -226,8 +233,8 @@ class LintRunner(object):
func = tokens[4]
message = tokens[5]
- if not self.config.ignore(fn, code, codename, message):
- exceptions.add((fn, ln, code, codename, func, message))
+ if not self.config.ignore(fn, code, codename, message):
+ exceptions.add((fn, ln, code, codename, func, message))
return exceptions