rwx/sh/shellcheck.sh
2024-11-29 12:17:39 +01:00

21 lines
415 B
Bash

sh_shellcheck() {
local root="${1}"
local file module modules path
file="$(mktemp)"
modules="$(sh_find_sh "${root}")"
_sh_ifs_new
for module in ${modules}; do
path="${root}/${module}"
shfmt --diff "${path}"
echo ". \"${path}\"" >>"${file}"
done
_sh_ifs_pop
shellcheck \
--check-sourced \
--enable "all" \
--exclude "3043" \
--external-sources \
--shell "dash" \
"${file}"
rm "${file}"
}