From b1fb9f2f0b992b777e8aeb69638bfcc99e1670e9 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 12 Apr 2022 16:40:31 -0700 Subject: [PATCH] Fix, not ignore, shellcheck SC1091 warnings This is easy to fix (but we have to specify -x). Signed-off-by: Kir Kolyshkin --- Makefile | 8 ++++---- scripts/ci/docker-test.sh | 3 ++- test/others/config-file/run.sh | 2 +- test/others/crit/test.sh | 3 ++- test/others/criu-coredump/test.sh | 2 +- test/others/libcriu/run.sh | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 436ebfd0d..537720339 100644 --- a/Makefile +++ b/Makefile @@ -423,10 +423,10 @@ lint: shellcheck --version shellcheck scripts/*.sh shellcheck scripts/ci/*.sh scripts/ci/apt-install - shellcheck test/others/crit/*.sh - shellcheck test/others/libcriu/*.sh - shellcheck test/others/crit/*.sh test/others/criu-coredump/*.sh - shellcheck test/others/config-file/*.sh + shellcheck -x test/others/crit/*.sh + shellcheck -x test/others/libcriu/*.sh + shellcheck -x test/others/crit/*.sh test/others/criu-coredump/*.sh + shellcheck -x test/others/config-file/*.sh codespell # Do not append \n to pr_perror or fail ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>.*\\n"' diff --git a/scripts/ci/docker-test.sh b/scripts/ci/docker-test.sh index ca93ed77c..eacfe136e 100755 --- a/scripts/ci/docker-test.sh +++ b/scripts/ci/docker-test.sh @@ -1,6 +1,6 @@ #!/bin/bash -# shellcheck disable=SC1091,SC2015 +# shellcheck disable=SC2015 set -x -e -o pipefail @@ -19,6 +19,7 @@ add-apt-repository \ ./apt-install docker-ce +# shellcheck source=/dev/null . /etc/lsb-release # docker checkpoint and restore is an experimental feature diff --git a/test/others/config-file/run.sh b/test/others/config-file/run.sh index 92195883e..26b835b45 100755 --- a/test/others/config-file/run.sh +++ b/test/others/config-file/run.sh @@ -11,7 +11,7 @@ set -xbm -#shellcheck disable=SC1091 +# shellcheck source=test/others/env.sh source ../env.sh if [ ! -d /etc/criu ]; then diff --git a/test/others/crit/test.sh b/test/others/crit/test.sh index 0d38043d7..7db88e0a9 100755 --- a/test/others/crit/test.sh +++ b/test/others/crit/test.sh @@ -1,8 +1,9 @@ #!/bin/bash -# shellcheck disable=SC1091,SC2002 +# shellcheck disable=SC2002 set -x +# shellcheck source=test/others/env.sh source ../env.sh images_list="" diff --git a/test/others/criu-coredump/test.sh b/test/others/criu-coredump/test.sh index dd774e298..9b6e56475 100755 --- a/test/others/criu-coredump/test.sh +++ b/test/others/criu-coredump/test.sh @@ -1,7 +1,7 @@ #!/bin/bash set -x -# shellcheck disable=SC1091 +# shellcheck source=test/others/env.sh source ../env.sh || exit 1 function gen_imgs { diff --git a/test/others/libcriu/run.sh b/test/others/libcriu/run.sh index 77bdfb87e..f7d363aab 100755 --- a/test/others/libcriu/run.sh +++ b/test/others/libcriu/run.sh @@ -9,7 +9,7 @@ TEST_LOG="${TEST_DIR}/test.log" DUMP_LOG="${TEST_DIR}/dump.log" RESTORE_LOG="${TEST_DIR}/restore.log" -# shellcheck disable=1091 +# shellcheck source=test/others/env.sh source "${MAIN_DIR}/../env.sh" || exit 1 echo "== Clean"