From 460c2eb9677406df9b357ea52113ef6d2bb9ec35 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 23 Oct 2024 15:44:06 +0200 Subject: [PATCH] ci: move shellcheck options to .shellcheckrc That way, IDEs get to have the same behaviour as the CI Part-of: --- .gitlab-ci/run-shellcheck.sh | 2 +- .gitlab-ci/test/gitlab-ci.yml | 1 + .shellcheckrc | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .shellcheckrc diff --git a/.gitlab-ci/run-shellcheck.sh b/.gitlab-ci/run-shellcheck.sh index 79d8ab3597a..76dea93e4a9 100755 --- a/.gitlab-ci/run-shellcheck.sh +++ b/.gitlab-ci/run-shellcheck.sh @@ -13,7 +13,7 @@ anyfailed=0 while IFS= read -r -d $'' file; do if is_bash "$file" ; then - if ! shellcheck -x -W0 -s bash "$file"; then + if ! shellcheck "$file"; then anyfailed=1 fi fi diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml index 6eaeb8e8672..ca845027865 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -65,6 +65,7 @@ yaml-toml-shell-test: changes: &toml_lint_files - .gitlab-ci/test/gitlab-ci.yml - .gitlab-ci/**/*.sh + - .shellcheckrc - bin/toml_lint.py - src/**/ci/*.toml when: on_success diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 00000000000..8534815fdc0 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,10 @@ +# Allow using `source` to execute the contents of other files than the one +# being checked. +external-sources=true + +# Do not print links to wiki pages explaining why this is an issue. +wiki-link-count=0 + +# All shell scripts are being run using bash, even if they are lacking +# a shebang. +shell=bash