[util] Display Python lint error messages
The lintpy utility currently doesn't display the output from the linter
unless the `--fix` option is used, which isn't available for flake8 at
all. Change the script to output the linter stdout/stderr in all cases.
Signed-off-by: Philipp Wagner <phw@lowrisc.org>
diff --git a/util/lintpy.py b/util/lintpy.py
index aa4d502..dc4c9c0 100755
--- a/util/lintpy.py
+++ b/util/lintpy.py
@@ -61,8 +61,6 @@
return (True, True)
except subprocess.CalledProcessError as exc:
sys.stderr.write('Lint failed:\n {}\n'.format(' '.join(check_cmd)))
- if not dofix or fix is None:
- return (True, True)
if exc.output:
output = exc.output.decode(sys.getfilesystemencoding())
@@ -71,6 +69,9 @@
sep='',
file=sys.stderr)
+ if not dofix or fix is None:
+ return (True, True)
+
print("Fixing...", file=sys.stderr)
subprocess.check_call(fix + files,
stderr=subprocess.STDOUT,