Fix lint script not linting all files
This part: https://gitlab.com/starting-spark/porter/frontend/-/blob/master/scripts/lint_app/lint_shell.sh#L8-11
shellcheck -- *.sh
for file in scripts/**/*.sh; do
shellcheck "$file"
done
needs to include the scripts immediately within scripts/
folder, with something along the lines of:
shellcheck -- *.sh
shellcheck -- scripts/*.sh
for file in scripts/**/*.sh; do
shellcheck "$file"
done
Additional Reference Code This code might capture findings better for the pipeline:
findings_found=0
_update_findings_count() {
findings_found=$((findings_found + 1))
}
shellcheck --external -- *.sh || _update_findings_count
shellcheck --external -- scripts/*.sh || _update_findings_count
for file in scripts/**/*.sh; do
shellcheck --external "$file" || _update_findings_count
done
exit $findings_found
Edited by Zhao Li