|
|
@ -13,6 +13,11 @@ for shellscript in "${shellscript_locations[@]}"; do
|
|
|
|
echo -e "${ANSI_GREEN}Running shellcheck on ${shellscript}"
|
|
|
|
echo -e "${ANSI_GREEN}Running shellcheck on ${shellscript}"
|
|
|
|
shellcheck "${shellscript}" || SHELLSCRIPT_ERROR=1
|
|
|
|
shellcheck "${shellscript}" || SHELLSCRIPT_ERROR=1
|
|
|
|
echo -e "${ANSI_GREEN}Running shfmt on ${shellscript}"
|
|
|
|
echo -e "${ANSI_GREEN}Running shfmt on ${shellscript}"
|
|
|
|
|
|
|
|
if ! shfmt -i 4 "${shellscript}" >/dev/null 2>&1; then
|
|
|
|
|
|
|
|
echo -e "${ANSI_RED}Warning: ${shellscript} contains the following problem:"
|
|
|
|
|
|
|
|
shfmt -i 4 "${shellscript}" || SHELLSCRIPT_ERROR=1
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
fi
|
|
|
|
if [ "$(cat "${shellscript}")" != "$(shfmt -i 4 "${shellscript}")" ]; then
|
|
|
|
if [ "$(cat "${shellscript}")" != "$(shfmt -i 4 "${shellscript}")" ]; then
|
|
|
|
echo -e "${ANSI_RED}Warning: ${shellscript} does not abide by coding style, diff for expected style:"
|
|
|
|
echo -e "${ANSI_RED}Warning: ${shellscript} does not abide by coding style, diff for expected style:"
|
|
|
|
shfmt -i 4 "${shellscript}" | diff "${shellscript}" - || SHELLSCRIPT_ERROR=1
|
|
|
|
shfmt -i 4 "${shellscript}" | diff "${shellscript}" - || SHELLSCRIPT_ERROR=1
|
|
|
|