aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2017-01-08 13:22:26 +0100
committerSimon Warta <[email protected]>2017-01-09 19:02:59 +0100
commit8df51e13900fe5d2fa7563071cd2063c4ef6f4e8 (patch)
tree2dadcaed17d04bf9c4289d2f1d6db7f1f230714d
parent1f38e996facb1c7fae8804331952beadecbf89d0 (diff)
Add initial pylint CI setup
-rw-r--r--.travis.yml9
-rwxr-xr-xsrc/scripts/ci/travis/install.sh5
-rwxr-xr-xsrc/scripts/ci/travis/lint.sh8
-rwxr-xr-xsrc/scripts/ci/travis/main.sh11
4 files changed, 31 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index d62305f93..6a1a299eb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,6 +24,7 @@ env:
matrix:
- BUILD_MODE="docs"
+ - BUILD_MODE="lint"
- BUILD_MODE="mini-shared"
- BUILD_MODE="mini-static"
- BUILD_MODE="shared"
@@ -45,13 +46,15 @@ matrix:
allow_failures:
- os: linux
env: BUILD_MODE="cross-win32"
+ - os: linux
+ env: BUILD_MODE="lint"
exclude:
# Skip GCC on OS X entirely
- os: osx
compiler: gcc
- # Run docs, bsi, nist, coverage, valgrind, sonarqube, sanitizer,
+ # Run docs, lint, bsi, nist, coverage, valgrind, sonarqube, sanitizer,
# minimized and non-ARM cross builds on Linux/gcc only. The
# sanitizer builds under Clang run the tests very slowly and cause
# CI timeouts.
@@ -61,6 +64,8 @@ matrix:
- compiler: clang
env: BUILD_MODE="nist"
- compiler: clang
+ env: BUILD_MODE="lint"
+ - compiler: clang
env: BUILD_MODE="docs"
- compiler: clang
env: BUILD_MODE="coverage"
@@ -93,7 +98,7 @@ install:
- ./src/scripts/ci/travis/install.sh
script:
- - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./src/scripts/ci/travis/build.sh ; fi
+ - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./src/scripts/ci/travis/main.sh ; fi
after_success:
- ./src/scripts/ci/travis/after_success.sh
diff --git a/src/scripts/ci/travis/install.sh b/src/scripts/ci/travis/install.sh
index f430cb4ea..bea57cc82 100755
--- a/src/scripts/ci/travis/install.sh
+++ b/src/scripts/ci/travis/install.sh
@@ -20,6 +20,11 @@ fi
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get -qq update
+ if [ "$BUILD_MODE" = "lint" ]; then
+ pip install --user pylint
+ pip3 install --user pylint
+ fi
+
if [ "$BUILD_MODE" = "docs" ]; then
sudo apt-get install doxygen
diff --git a/src/scripts/ci/travis/lint.sh b/src/scripts/ci/travis/lint.sh
new file mode 100755
index 000000000..fe72ff589
--- /dev/null
+++ b/src/scripts/ci/travis/lint.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -ev
+which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available
+
+echo "travis_fold:start:pylint"
+python3 -m pylint configure.py
+python2 -m pylint configure.py
+echo "travis_fold:end:pylint"
diff --git a/src/scripts/ci/travis/main.sh b/src/scripts/ci/travis/main.sh
new file mode 100755
index 000000000..ed6f56063
--- /dev/null
+++ b/src/scripts/ci/travis/main.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -ev
+which shellcheck > /dev/null && shellcheck "$0" # Run shellcheck on this if available
+
+PARENT_DIR=$(dirname "$0")
+
+if [ "$BUILD_MODE" = "lint" ]; then
+ "$PARENT_DIR"/lint.sh
+else
+ "$PARENT_DIR"/build.sh
+fi