diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rwxr-xr-x | clang-tidy-diff.sh | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index 373f7ebf7..083c919a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,14 +33,16 @@ jobs: stage: test addons: apt: - packages: ['python3-pip'] + packages: ['cmake', 'python3-pip'] install: pip3 install --user flake8==3.7.8 script: - flake8 - - ./clang-tidy-diff.sh - ./clang-format-diff.sh # ensure generated parser is up to date - ./scripts/gen-s-parser.py | diff src/gen-s-parser.inc - + # clang-tidy requires compile_commands.json generated by cmake + - cmake ${TRAVIS_BUILD_DIR} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + - ./clang-tidy-diff.sh # Build with clang and run tests on the host system (Ubuntu). - &test-ubuntu diff --git a/clang-tidy-diff.sh b/clang-tidy-diff.sh index 6827f125b..5f3495504 100755 --- a/clang-tidy-diff.sh +++ b/clang-tidy-diff.sh @@ -20,7 +20,7 @@ CLANG_TIDY_DIFF=$CLANG_DIR/share/clang/clang-tidy-diff.py TIDY_MSG=$(git diff -U0 $BRANCH... | $CLANG_TIDY_DIFF -quiet -p1 2> /dev/null) if [ -n "$TIDY_MSG" -a "$TIDY_MSG" != "No relevant changes found." ] then - echo "Please run clang-tidy before committing, or apply this diff:" + echo "Please fix clang-tidy errors before committing" echo # Run clang-tidy once again to show the error git diff -U0 $BRANCH... | $CLANG_TIDY_DIFF -quiet -p1 2> /dev/null |