The caveats are somewhat of a deal breaker unfortunately. It fails on perfectly valid syntax because they don't want to complicate the parser. But that makes the tool not very useful.
Another gem from the same repo - gosh - pure golang shell<p>This means anywhere golang is installed, including aarch64 Darwin and Windows you can:<p><pre><code> go run mvdan.cc/sh/v3/cmd/gosh@latest
</code></pre>
Or things like<p><pre><code> go run mvdan.cc/sh/v3/cmd/gosh@latest -c 'echo "cross platform shell"; go run github.com/mikefarah/yq/v3@latest r metadata.name <(kubectl get pod my-pod -o yaml)'
</code></pre>
Pretty awesome stuff, I'm always discovering new ways to use it.
I use shfmt and shellcheck together with pre-commit. I like to use the shfmt-py and shellcheck-py pre-commit hooks as opposed to <a href="https://github.com/jumanjihouse/pre-commit-hooks">https://github.com/jumanjihouse/pre-commit-hooks</a> as they'll install the shfmt/shellcheck prebuilt binaries as needed:<p><a href="https://github.com/maxwinterstein/shfmt-py">https://github.com/maxwinterstein/shfmt-py</a><p><a href="https://github.com/shellcheck-py/shellcheck-py">https://github.com/shellcheck-py/shellcheck-py</a>
And if you use fish, it comes with a built-in formatting function.<p><a href="https://fishshell.com/docs/current/cmds/fish_indent.html" rel="nofollow">https://fishshell.com/docs/current/cmds/fish_indent.html</a>