X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-analyses%2Fpylint.sh;h=a4b38b0e675cc575c8eb73583a4130cbe50042b1;hb=80eda7bbc241122a6f1e98e37f9ae66c04dcca03;hp=9475339bba183e3da6e0cfe8da9b6cd6dc6eaef9;hpb=c7b16cb8f1862c9d51bc8542fbc7cd10388add13;p=lttng-ci.git diff --git a/scripts/lttng-analyses/pylint.sh b/scripts/lttng-analyses/pylint.sh index 9475339..a4b38b0 100755 --- a/scripts/lttng-analyses/pylint.sh +++ b/scripts/lttng-analyses/pylint.sh @@ -1,6 +1,6 @@ -#!/bin/bash -exu +#!/bin/bash # -# Copyright (C) 2015 - Michael Jeanson +# Copyright (C) 2020 Michael Jeanson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,10 +15,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +set -exu + SRCDIR="src/lttng-analyses" PYTHON3="python3" -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build @@ -35,15 +37,14 @@ fi # Create virtualenv and install necessary packages virtualenv --system-site-packages -p $PYTHON3 "$PYENV_HOME" -set +u +set +ux +# shellcheck disable=SC1090 . "$PYENV_HOME/bin/activate" -set -u +set -ux pip install --quiet pylint -pip install --quiet pep8 -cd "$SRCDIR" -pep8 lttnganalyses | tee "$WORKSPACE/pep8.out" +cd "$SRCDIR" pylint -f parseable --ignore="_version.py" --disable=C0111 lttnganalyses | tee "$WORKSPACE/pylint.out"