File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
content/assignments/lambda-function-loader/tests Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -108,3 +108,16 @@ jobs:
108108 with :
109109 options : " --check --diff"
110110 src : ${{ env.FILES }}
111+
112+ shellcheck : # Runs on all shell scripts in the repository.
113+ runs-on : ubuntu-latest
114+ steps :
115+ - uses : actions/checkout@v4
116+ with :
117+ fetch-depth : 0
118+
119+ - name : shellcheck
120+ 121+ with :
122+ version : v0.10.0
123+ severity : " warning"
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ clean: stop_bash
4040cleanall : clean
4141 -docker inspect --type=image $(IMAGE_NAME ) > /dev/null 2>&1 && docker image rm $(IMAGE_NAME )
4242
43- .PHONY : lint markdownlint cpplint black
44- lint : markdownlint cpplint black
43+ .PHONY : lint markdownlint cpplint black shellcheck
44+ lint : markdownlint cpplint black shellcheck
4545
4646CHANGED_MD_FILES = $(call get_changed_files,\.md$$)
4747markdownlint :
@@ -68,6 +68,14 @@ black:
6868 black --check --diff $(CHANGED_PY_FILES ) ; \
6969 fi
7070
71+ CHANGED_SHELL_FILES = $(call get_changed_files,\.\(sh\|bash\) $$)
72+ shellcheck :
73+ @echo " Checking shell scripts ..."
74+ @if [ " $( CHANGED_SHELL_FILES) " ]; then \
75+ docker run --rm -v $(PWD ) :/data --workdir=/data koalaman/shellcheck-alpine:v0.10.0 \
76+ shellcheck --severity=warning $(CHANGED_SHELL_FILES ) ; \
77+ fi
78+
7179# Get a list of files that changed in the current branch and match the given pattern
7280define get_changed_files # $(1 ) : pattern
7381$(shell git diff --name-only HEAD $(shell git merge-base HEAD main) | grep "$(1)" | tr '\n' ' ')
Original file line number Diff line number Diff line change @@ -501,7 +501,10 @@ main() {
501501 run_tests " $@ "
502502
503503 if [[ $# -eq 0 ]]; then
504- PADDING=$( printf ' .%.0s' $( eval echo " {1..$(( PADDING_LEN+ 6 )) }" ) )
504+ PADDING=" "
505+ for (( i= 0 ; i< ((PADDING_LEN+ 6 )) ; i++)); do
506+ PADDING+=" ."
507+ done
505508 printf " Total Score%s[%+3s/%-3s]\n" " $PADDING " $TOTAL_SCORE $MAX_TOTAL_SCORE
506509 fi
507510}
You can’t perform that action at this time.
0 commit comments