34 lines
602 B
1
rwx_shellcheck() {
2
local root="${1}"
3
local file module modules path
4
file="$(mktemp)"
5
modules="$(rwx_find_shell "${root}")"
6
rwx_ifs_set
7
for module in ${modules}; do
8
path="${root}/${module}"
9
echo ". \"${path}\"" >>"${file}"
10
done
11
rwx_ifs_unset
12
rwx_shellcheck_file "${file}"
13
rwx_remove "${file}"
14
}
15
16
rwx_shellcheck_file() {
17
local file="${1}"
18
shellcheck \
19
--check-sourced \
20
--enable "all" \
21
--exclude "3043" \
22
--external-sources \
23
--shell "dash" \
24
"${file}"
25
}
26
27
rwx_shellcheck_write() {
28
rwx_file_write ".shellcheckrc" "\
29
disable=3043
30
enable=all
31
external-sources=true
32
shell=sh
33
"
34
}
35