forked from Archive/PX4-Autopilot
Jenkins add ShellCheck
This commit is contained in:
parent
2164ef8fb6
commit
3c4c9131aa
|
@ -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
|
||||
|
||||
|
|
3
Makefile
3
Makefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue