- 'gerrit'
- job-template:
- name: dev_gerrit_babeltrace_black
+ name: dev_gerrit_babeltrace_pylint
defaults: babeltrace
concurrent: true
builders:
- shell:
- !include-raw-escape: scripts/babeltrace/black.sh
+ !include-raw-escape: scripts/babeltrace/pylint.sh
properties:
- inject:
defaults: babeltrace
node: 'amd64'
- scm: []
-
triggers:
- pollscm:
cron: "@daily"
builders:
- - copyartifact:
- project: babeltrace_{version}_build/arch=amd64,build=std,conf=python-bindings
- which-build: last-successful
- stable: false
- filter: 'build/**'
- target: 'deps/babeltrace'
- shell:
!include-raw-escape: scripts/babeltrace/pylint.sh
publishers:
- archive:
- artifacts: 'pep8.out,pylint.out'
- - violations:
- pep8:
- pattern: pep8.out
- min: 10
- max: 999
- unstable: 999
- pylint:
- pattern: pylint.out
- min: 10
- max: 999
- unstable: 999
+ artifacts: 'black.out,flake8.out'
- email-ext:
recipients: '{obj:email_to}'
reply-to: ci-notification@lists.lttng.org
conf: !!python/tuple [std]
- 'babeltrace_{version}_cppcheck'
- 'babeltrace_{version}_scan-build'
- - 'babeltrace_{version}_pylint'
- project:
name: babeltrace2
build: !!python/tuple [std]
conf: !!python/tuple [std, prod]
filter: ''
- - 'dev_gerrit_babeltrace_black'
+ - 'dev_gerrit_babeltrace_pylint'
- project:
+++ /dev/null
-#!/bin/sh -exu
-#
-# Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
-# Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
-#
-# 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PYTHON3=python3
-
-PYENV_HOME="$WORKSPACE/.pyenv/"
-
-# Delete previously built virtualenv
-if [ -d "$PYENV_HOME" ]; then
- rm -rf "$PYENV_HOME"
-fi
-
-# Create virtualenv and install necessary packages
-virtualenv --system-site-packages -p ${PYTHON3} "$PYENV_HOME"
-
-set +ux
-. "$PYENV_HOME/bin/activate"
-set -ux
-
-pip install --quiet black
-
-black --diff --check src/babeltrace
#!/bin/sh -exu
#
-# Copyright (C) 2015 - Michael Jeanson <mjeanson@efficios.com>
+# Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
+# Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
#
# 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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-BABELTRACE_DIR="deps/babeltrace/build"
-
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/"
# 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 | tee ../../flake8.out || exit_code=1
-pylint -f parseable --ignore="nativebt.py" "$BINDINGS_DIR" | tee pylint.out
+exit $exit_code