aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2018-01-11 11:09:45 -0800
committerRoss Brattain <ross.b.brattain@intel.com>2018-01-11 11:10:19 -0800
commit5702f5b5e0721d9af61e494691376f32652e0048 (patch)
tree1094c6609f5be0749d35b88d53cccb30b275e3bd
parent94d3b53e1e079a6f0b2ec1e5106e19067a0c00a9 (diff)
pylint: make Jenkins output parseable
Jenkins doesn't handle the color and the output is hard to read in Jenkins logs Change-Id: Ie8fc5a78e89f72c829e4bbbcbd1291a723dfde72 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r--tools/coding-checks.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/coding-checks.sh b/tools/coding-checks.sh
index 4ee909988..6a12a1e99 100644
--- a/tools/coding-checks.sh
+++ b/tools/coding-checks.sh
@@ -28,6 +28,7 @@ process_options () {
run_pylint () {
local target="${scriptargs:-all}"
+ local output_format=""
if [ "$target" = "all" ]; then
files="ansible api tests yardstick"
@@ -37,11 +38,15 @@ run_pylint () {
*) echo "$target is an unrecognized basecommit"; exit 1;;
esac
fi
-
+ # make Jenkins output parseable because Jenkins doesn't handle color
+ # enventually we should use the Jenkins Pylint plugin or other tools
+ if [ -n "${JENKINS_HOME:-}" ] ; then
+ output_format="--output-format=parseable"
+ fi
echo "Running pylint..."
echo "You can speed this up by running it on 'HEAD~[0-9]' (e.g. HEAD~0, this change only)..."
if [ -n "${files}" ]; then
- pylint --rcfile=.pylintrc ${files}
+ pylint --rcfile=.pylintrc ${output_format} ${files}
else
echo "No python changes in this commit, pylint check not required."
exit 0