shellcheck for our shell scripts?

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Freyther holger at freyther.de
Sat Sep 15 07:35:48 UTC 2018


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/


More information about the OpenBSC mailing list