From 0f8995f0c7cedf3fd1cec73bf35491335342b5d7 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sat, 25 Oct 2025 16:38:31 +1000 Subject: [PATCH] pre-commit: add `shellcheck` and clean shell files "ShellCheck, a static analysis tool for shell scripts" https://github.com/shellcheck-py/shellcheck-py A wrapper for: https://github.com/koalaman/shellcheck https://shellcheck.net/ --- .pre-commit-config.yaml | 6 ++++++ .../support/src/main/resources/createKeyStore.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79dcf5e826..3a9ea6e9f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,3 +64,9 @@ repos: name: run oxipng description: check PNG files with oxipng args: ['--fix', '-o', '4', '--strip', 'safe', '--alpha'] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.11.0.1 + hooks: + - id: shellcheck + name: run shellcheck + description: check Shell scripts with shellcheck diff --git a/integration-tests/support/src/main/resources/createKeyStore.sh b/integration-tests/support/src/main/resources/createKeyStore.sh index bf710859f7..8462209637 100755 --- a/integration-tests/support/src/main/resources/createKeyStore.sh +++ b/integration-tests/support/src/main/resources/createKeyStore.sh @@ -30,9 +30,10 @@ set -e # programmatically: `System.setProperty("javax.net.ssl.trustStore", "/path/to/keystore")` dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +# shellcheck disable=SC2034 keystore_file="${dir}/test-keystore.jks" file_prefix="${dir}/test-keystore" -rm -f ${file_prefix}* +rm -f "${file_prefix}"* echo "generate new keystore" keytool -genkey \