Jenkins add ShellCheck

This commit is contained in:
Daniel Agar 2018-08-17 21:21:41 -04:00 committed by Lorenz Meier
parent 2164ef8fb6
commit 3c4c9131aa
3 changed files with 24 additions and 1 deletions

15
Jenkinsfile vendored
View File

@ -160,6 +160,21 @@ pipeline {
}
}
stage('ShellCheck') {
agent {
docker {
image 'px4io/px4-dev-base:2018-08-23'
args '-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'make distclean'
sh 'make shellcheck'
sh 'make distclean'
}
}
} // parallel
} // stage Analysis

View File

@ -360,6 +360,9 @@ cppcheck: posix_sitl_default
@cppcheck -i$(SRC_DIR)/src/examples --enable=performance --std=c++11 --std=c99 --std=posix --project=$(SRC_DIR)/build/posix_sitl_default/compile_commands.json --xml-version=2 2> $(SRC_DIR)/build/cppcheck/cppcheck-result.xml > /dev/null
@cppcheck-htmlreport --source-encoding=ascii --file=$(SRC_DIR)/build/cppcheck/cppcheck-result.xml --report-dir=$(SRC_DIR)/build/cppcheck --source-dir=$(SRC_DIR)/src/
shellcheck:
@$(SRC_DIR)/Tools/run-shellcheck.sh $(SRC_DIR)/ROMFS/px4fmu_common/
# Cleanup
# --------------------------------------------------------------------
.PHONY: clean submodulesclean submodulesupdate gazeboclean distclean

View File

@ -24,7 +24,12 @@ echo "Running shellcheck in '$search_directory'."
# SC2086: double quote to prevent globbing and word splitting
# SC2166: allow the form [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ]
# SC2148: allow files w/o shebang
shellcheck -a -x -e SC2121 -e SC1008 -e SC2086 -e SC2166 -e SC2148 \
shellcheck -x \
-e SC1008 \
-e SC2086 \
-e SC2121 \
-e SC2148 \
-e SC2166 \
$scripts
ret=$?
if [ $ret -ne 0 ]; then