From 1fe6e514a72f51103ab0cbe91ca91aae8770da4e Mon Sep 17 00:00:00 2001 From: Jake Hageman Date: Fri, 6 Dec 2019 11:09:07 -0500 Subject: [PATCH] Enforc strict cppcheck in CI --- .travis.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 800d2cf8f..6dc220d6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,17 @@ script: - cp cfe/cmake/Makefile.sample Makefile - cp -r cfe/cmake/sample_defs sample_defs # Static code analysis - - cppcheck --force --inline-suppr . + # Below is intent but fails - exit code bug in cppcheck 1.82 + # - cppcheck --force --inline-suppr --quiet --error-exitcode=1 . + # Work around script: + - cppcheck --force --inline-suppr --quiet . 2> cppcheck_err.txt + - | + if [[ -s cppcheck_err.txt ]]; then + echo "You must fix cppcheck errors before submitting a pull request" + echo "" + cat cppcheck_err.txt + exit -1 + fi # Prep and build - make prep - make