bash3boilerplate
bash3boilerplate copied to clipboard
better style guide checking (properly parse bash vs regex-hit-and-miss)
See discussion in PR #81
Some potentially helpful links:
- https://github.com/vorpaljs/bash-parser
- https://github.com/idank/bashlex
- https://github.com/grncdr/js-shell-parse
- http://hackage.haskell.org/package/language-sh
- https://google.github.io/styleguide/shell.xml
- https://github.com/bahamas10/bash-style-guide
- http://wiki.bash-hackers.org/scripting/style
- https://github.com/skudriashev/bashlint
what about shfmt (https://github.com/mvdan/sh) ? it seems to be opinionated as in there is no way to influence the acceptable style but at least it is readily available in homebrew
Looks promising at first glance, have you ran it against any code?
yes. strangely it wants to change all if [[ $var = "x" ]]
to if [[ $var == "x" ]]
. Other than that it just removes some empty lines.
Shellcheck could be nice too https://github.com/koalaman/shellcheck
@kenden we already use shellcheck. This is about style beyond linting/syntax checking 😉
A complete Bash parser in JavaScript transpiled from Go https://www.npmjs.com/package/mvdan-sh #hackernews
also found this yesterday, just sharing as it might interest you https://google.github.io/styleguide/shell.xml