Hey,
I recently stumbled across shellcheck[1] and think we should make it a goal that our shell
scripts don't produce errors/warnings with it.
Some of the examples in the GSM tester:
In jenkins-build-common.sh line 76:
cd "$base"
^-- SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd
fails.
In jenkins-build-common.sh line 93:
rm -rf *
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become
options.
What do you think? My approach would be:
* Install shellcheck into our build containers
* Run them and provide warnings
* Fix them over time and on new code
* Make CI fail with failures
cheers
holger
[1]
https://www.shellcheck.net/