shfmt is a shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. https://github.com/mvdan/sh
I added this to Guru last weekend.
In ::gentoo now too as dev-util/sh.