From 26449bcccf9b702d60f6e565c9186b4bd50036af Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 10 Sep 2021 02:32:30 +0300 Subject: [PATCH] Merge #15166: qa: Pin shellcheck version a517541794 Remove no longer needed shellcheck suppressions (practicalswift) 0b7196ecad Fix warnings introduced in shellcheck v0.6.0 (practicalswift) 07a53dce9f Remove repeated suppression. Fix indentation. (practicalswift) 638e53b472 Pin shellcheck version to v0.6.0 (practicalswift) Pull request description: Pin `shellcheck` version. Tree-SHA512: 996e438e424020fe888de1d77ffd33fa32848332febfffbc21a842784aee339332c79c41687c9c577ba1206eb20674623157d584a072e8ae88ae086ee2277bc8 --- .travis/lint_04_install.sh | 4 ++++ ci/Dockerfile.builder | 6 +++++- test/lint/lint-shell.sh | 7 ++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis/lint_04_install.sh b/.travis/lint_04_install.sh index 1b4b6111c4..388da9ee66 100755 --- a/.travis/lint_04_install.sh +++ b/.travis/lint_04_install.sh @@ -10,3 +10,7 @@ travis_retry pip install codespell==1.13.0 travis_retry pip install flake8==3.5.0 travis_retry pip install vulture==0.29 travis_retry pip3 install yq + +SHELLCHECK_VERSION=v0.6.0 +curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/ +export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}" diff --git a/ci/Dockerfile.builder b/ci/Dockerfile.builder index abbe621ca9..6dcdfc0849 100644 --- a/ci/Dockerfile.builder +++ b/ci/Dockerfile.builder @@ -40,9 +40,13 @@ RUN apt-get update && apt-get install $APT_ARGS g++-arm-linux-gnueabihf && rm -r RUN apt-get update && apt-get install $APT_ARGS g++-mingw-w64-x86-64 && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install $APT_ARGS wine-stable wine32 wine64 bc nsis xorriso && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install $APT_ARGS python3-zmq && rm -rf /var/lib/apt/lists/* -RUN apt-get update && apt-get install $APT_ARGS shellcheck cppcheck && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install $APT_ARGS cppcheck && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install $APT_ARGS imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools && rm -rf /var/lib/apt/lists/* +ARG SHELLCHECK_VERSION=v0.6.0 +RUN curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/ +ENV PATH "/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}" + # This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is # due to gcc-multilib installing the following symbolic link, which is needed for -m32 support. However, this causes # arm builds to also have the asm folder implicitly in the include search path. This is kind of ok, because the asm folder diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh index f15324d4c1..4b0619a926 100755 --- a/test/lint/lint-shell.sh +++ b/test/lint/lint-shell.sh @@ -13,13 +13,12 @@ export LC_ALL=C # respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh # but unset here in case of running in Travis. if [ "$TRAVIS" = "true" ]; then - unset LC_ALL + unset LC_ALL fi # Disabled warnings: disabled=( SC1087 # Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet). - SC1117 # Backslash is literal in "\.". Prefer explicit escaping: "\\.". SC2001 # See if you can use ${variable//search/replace} instead. SC2004 # $/${} is unnecessary on arithmetic variables. SC2005 # Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. @@ -31,10 +30,8 @@ disabled=( SC2066 # Since you double quoted this, it will not word split, and the loop will only run once. SC2086 # Double quote to prevent globbing and word splitting. SC2116 # Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. - SC2148 # Tips depend on target shell and yours is unknown. Add a shebang. SC2162 # read without -r will mangle backslashes. - SC2166 # Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. - SC2166 # Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. + SC2166 # Prefer [ p ] {&&,||} [ q ] as [ p -{a,o} q ] is not well defined. SC2181 # Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. SC2206 # Quote to prevent word splitting, or split robustly with mapfile or read -a. SC2207 # Prefer mapfile or read -a to split command output (or quote to avoid splitting).