diff options
author | dundargoc <gocdundar@gmail.com> | 2022-10-30 13:50:41 +0100 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-11-01 18:37:21 +0100 |
commit | 502b5ee10fedc97e1455e7365a10c9bad7268c67 (patch) | |
tree | 76e48e2ff97cd7725d06f3e9a9521861584f6f12 /ci | |
parent | aeb87f8b4a87e99c392e7ec11b29b715e1f31ac3 (diff) | |
download | rneovim-502b5ee10fedc97e1455e7365a10c9bad7268c67.tar.gz rneovim-502b5ee10fedc97e1455e7365a10c9bad7268c67.tar.bz2 rneovim-502b5ee10fedc97e1455e7365a10c9bad7268c67.zip |
build(lint): add more shell scripts to lintsh
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/before_cache.sh | 2 | ||||
-rwxr-xr-x | ci/before_script.sh | 1 | ||||
-rw-r--r-- | ci/common/build.sh | 7 | ||||
-rw-r--r-- | ci/common/suite.sh | 4 | ||||
-rw-r--r-- | ci/common/test.sh | 6 | ||||
-rwxr-xr-x | ci/run_tests.sh | 3 |
6 files changed, 16 insertions, 7 deletions
diff --git a/ci/before_cache.sh b/ci/before_cache.sh index 9bc9bb45e9..3daeb04793 100755 --- a/ci/before_cache.sh +++ b/ci/before_cache.sh @@ -4,7 +4,9 @@ set -e set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/build.sh" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/suite.sh" mkdir -p "${HOME}/.cache" diff --git a/ci/before_script.sh b/ci/before_script.sh index 08e0cb9103..066789af36 100755 --- a/ci/before_script.sh +++ b/ci/before_script.sh @@ -4,6 +4,7 @@ set -e set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/build.sh" # Test some of the configuration variables. diff --git a/ci/common/build.sh b/ci/common/build.sh index 6e7ea2c8f8..e30d0337b5 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -7,7 +7,7 @@ _stat() { } top_make() { - printf '%78s\n' | tr ' ' '=' + printf '%78s\n' ' ' | tr ' ' '=' ninja "$@" } @@ -33,6 +33,7 @@ build_deps() { # update CMake configuration and update to newer deps versions. cd "${DEPS_BUILD_DIR}" echo "Configuring with '${DEPS_CMAKE_FLAGS}'." + # shellcheck disable=SC2086 CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/cmake.deps/" if ! top_make; then @@ -51,10 +52,10 @@ build_nvim() { mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" - echo "Configuring with '${CMAKE_FLAGS} $@'." + echo "Configuring with '${CMAKE_FLAGS} $*'." + # shellcheck disable=SC2086 cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}" - echo "Building nvim." if ! top_make nvim ; then exit 1 diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 0320ac15c3..c81261d2e7 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -9,12 +9,12 @@ fail() { local test_name="$1" local message="$2" - : ${message:=Test $test_name failed} + : "${message:=Test $test_name failed}" local full_msg="$test_name :: $message" echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}" echo "Failed: $full_msg" - FAILED=1 + export FAILED=1 } ended_successfully() { diff --git a/ci/common/test.sh b/ci/common/test.sh index 7db39a0e5f..326ec162c3 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -57,6 +57,7 @@ check_core_dumps() { check_logs() { # Iterate through each log to remove an useless warning. + # shellcheck disable=SC2044 for log in $(find "${1}" -type f -name "${2}"); do sed -i "${log}" \ -e '/Warning: noted but unhandled ioctl/d' \ @@ -66,6 +67,7 @@ check_logs() { # Now do it again, but only consider files with size > 0. local err="" + # shellcheck disable=SC2044 for log in $(find "${1}" -type f -name "${2}" -size +0); do cat "${log}" err=1 @@ -97,7 +99,7 @@ unittests() {( functionaltests() {( ulimit -c unlimited || true - if ! build_make ${FUNCTIONALTEST}; then + if ! build_make "${FUNCTIONALTEST}"; then fail 'functionaltests' 'Functional tests failed' fi submit_coverage functionaltest @@ -132,7 +134,7 @@ check_runtime_files() {( fail "$test_name" "It appears that $file is only a part of the file name" fi if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then - fail "$test_name" "$(printf "$message" "$file")" + fail "$test_name" "$(printf "%s%s" "$message" "$file")" fi done )} diff --git a/ci/run_tests.sh b/ci/run_tests.sh index da72d09506..20d758fd6d 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -4,8 +4,11 @@ set -e set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/build.sh" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/test.sh" +# shellcheck source-path=SCRIPTDIR source "${CI_DIR}/common/suite.sh" rm -f "$END_MARKER" |