[ci] Run shellcheck as part of code_layout build

This commit is contained in:
Nyall Dawson 2018-05-30 06:53:35 +10:00
parent 481461dea0
commit 7d938e8b94
2 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@ ADD_TEST(qgis_banned_keywords ${CMAKE_SOURCE_DIR}/tests/code_layout/test_banned_
ADD_TEST(qgis_licenses ${CMAKE_SOURCE_DIR}/tests/code_layout/test_licenses.sh)
ADD_TEST(qgis_spelling ${CMAKE_SOURCE_DIR}/scripts/spell_check/spell_test.sh)
ADD_TEST(qgis_shellcheck ${CMAKE_SOURCE_DIR}/tests/code_layout/test_shellcheck.sh)
ADD_TEST(qgis_sipify ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipify.sh)
ADD_TEST(qgis_sip_include ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sip_include.sh)
ADD_TEST(qgis_sip_uptodate ${CMAKE_SOURCE_DIR}/tests/code_layout/test_sipfiles_uptodate.sh)

View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# This runs shellcheck on all sh files
DIR=$(git rev-parse --show-toplevel)
pushd ${DIR} > /dev/null
result=$(shellcheck $(find . -name '*.sh'))
popd > /dev/null
if [[ $result ]]; then
echo " *** shellcheck found script errors"
echo "$result"
exit 1
fi