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/.

Oliver Smith osmith at sysmocom.de
Mon Sep 17 08:54:41 UTC 2018


Hi Pau,

On 9/15/18 10:07 PM, Pau Espin Pedrol wrote:> Regarding checking stuff
with shellcheck, it can be fine but it may be
> dangerous requiring fix of all warnings/errors, since some of them are
> sometimes really hard to fix. For instance doing some stuff in posix
> shell bs doing it for bash or whatever.

I've been using shellcheck a lot myself, and in my experience it is
actually feasible to require scripts having no warnings and errors. We
even have that set up as a CI test in a project.

It detects the shell from the shebang, so if one specifies #!/bin/bash,
it allows using the bash features. For warnings that are not helpful,
it's possible to add a line like the following above:

# shellcheck disable=SC2086

Regards,
Oliver

-- 
- Oliver Smith <osmith at sysmocom.de>            https://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte



More information about the OpenBSC mailing list