rwx/sh/lint/shellcheck.sh
2024-12-02 00:42:35 +01:00

29 lines
525 B
Bash

rwx_shellcheck() {
local root="${1}"
local file module modules path
file="$(mktemp)"
modules="$(rwx_find_shell "${root}")"
rwx_ifs_set
for module in ${modules}; do
path="${root}/${module}"
echo ". \"${path}\"" >>"${file}"
done
rwx_ifs_unset
shellcheck \
--check-sourced \
--enable "all" \
--exclude "3043" \
--external-sources \
--shell "dash" \
"${file}"
rwx_remove "${file}"
}
rwx_shellcheck_write() {
rwx_file_write ".shellcheckrc" "\
disable=3043
enable=all
external-sources=true
shell=sh
"
}