X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fbabeltrace%2Fpylint.sh;h=f04f8ad870856e826cf6ba49fee91b5797989977;hb=e468fc14fc62098528f9dd67efa77acf2aff16d8;hp=dc3950c0451af5a571db15ffcb66be0462b64395;hpb=944a6c86f6eab1c0b3d65c2f3f771764851baf05;p=lttng-ci.git diff --git a/scripts/babeltrace/pylint.sh b/scripts/babeltrace/pylint.sh index dc3950c..f04f8ad 100755 --- a/scripts/babeltrace/pylint.sh +++ b/scripts/babeltrace/pylint.sh @@ -1,6 +1,7 @@ -#!/bin/sh -exu +#!/bin/bash -exu # -# Copyright (C) 2015 - Michael Jeanson +# Copyright (C) 2019 Michael Jeanson +# Copyright (C) 2019 Francis Deslauriers # # 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,12 +16,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -BABELTRACE_DIR="deps/babeltrace/build" +set -o pipefail PYTHON3=python3 -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") - -BINDINGS_DIR="$BABELTRACE_DIR/lib/python${P3_VERSION}/dist-packages/babeltrace" PYENV_HOME="$WORKSPACE/.pyenv/" @@ -32,13 +30,18 @@ fi # Create virtualenv and install necessary packages virtualenv --system-site-packages -p ${PYTHON3} "$PYENV_HOME" -set +u +set +ux . "$PYENV_HOME/bin/activate" -set -u +set -ux + +pip install --quiet black +pip install --quiet flake8 + +exit_code=0 -pip install --quiet pylint -pip install --quiet pep8 +cd src/babeltrace -pep8 --exclude="nativebt.py" "$BINDINGS_DIR" | tee pep8.out +black --diff --check . | tee ../../black.out || exit_code=1 +flake8 --output-file=../../flake8.out --tee || exit_code=1 -pylint -f parseable --ignore="nativebt.py" "$BINDINGS_DIR" | tee pylint.out +exit $exit_code