From 3e3a8810af63d7f737cfce1ff9bc684027ffdb62 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 6 Aug 2018 18:49:02 +0000 Subject: Use tokstyle in the cmake travis build. This checks that (some of) the code follows some simplicity and naming guidelines set by the tool. --- .travis/cmake-linux | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to '.travis/cmake-linux') diff --git a/.travis/cmake-linux b/.travis/cmake-linux index bbfb7a96..347034af 100755 --- a/.travis/cmake-linux +++ b/.travis/cmake-linux @@ -8,7 +8,22 @@ CACHEDIR="$HOME/cache" NPROC=`nproc` ASTYLE="$CACHEDIR/astyle/build/gcc/bin/astyle" +install_tool() { + SLUG="$1" + TOOL="$2" + TARGET="$3" + + VERSION=$(curl -L -s -H 'Accept: application/json' \ + "https://github.com/$SLUG/releases/latest" \ + | egrep -o '"v[0-9][^"]+"' \ + | egrep -o '[^"]+') + URL="https://github.com/$SLUG/releases/download/$VERSION/$TOOL-x86_64-linux-$VERSION.tar.gz" + curl -L -s "$URL" | tar xzv -C "$TARGET" +} + travis_install() { + install_tool TokTok/hs-tokstyle tokstyle "$HOME/.local" + which coveralls || { # Install cpp-coveralls to upload test coverage results. pip install --user ndg-httpsclient urllib3[secure] cpp-coveralls @@ -57,6 +72,9 @@ travis_script() { other/astyle/format-source . "$ASTYLE" + echo "Running TokTok style checker" + "$HOME/.local/bin/check-cimple" + # Use () to run in a separate process so the exports are local. (run_static_analysis) -- cgit v1.2.3