Skip to content
Permalink
Browse files

[ci] Run shellcheck as part of code_layout build

  • Loading branch information
nyalldawson committed May 29, 2018
1 parent 481461d commit 7d938e8b947cc41ed954da320fb219c535b938f1
Showing with 16 additions and 0 deletions.
  1. +1 −0 tests/code_layout/CMakeLists.txt
  2. +15 −0 tests/code_layout/test_shellcheck.sh
@@ -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)
@@ -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

0 comments on commit 7d938e8

Please sign in to comment.
You can’t perform that action at this time.