shfmt seems to be the right one for the job. However, it does not seem to be commonly packaged in Linux distributions, and with that program, we would introduce another dependency to the static code analysis script, making it even harder to install everything to run it locally before submitting a PR (which is required to keep development enjoyable).
I guess I will use it personally for formatting, but not let Travis require this for now.
It would be more user friendly to package all dependencies for static code analysis for Alpine Linux, and then use pmbootstrap to install them inside the native chroot, and do the static code analysis from there. That way, the host system does not get touched, and users do not need to worry about the dependencies.
If someone thinks, that this is a bad idea, please speak up here in the thread. This is how I would do it:
Package shfmt, shellcheck (this one has 11 (!) new Haskell dependencies), autopep8, flake8 for Alpine Linux
Rewrite the static analysis script to:
Install all tools in the native chroot
Copy the pmbootstrap source folder into the chroot (in a temporary folder)