Bash Code Guidelines

Formatters and Linters

When writing Bash code for this project, please

  • Format your code with shfmt.

    To format a file run shfmt -ln=bash -i=4 -ci -sr -w path/to/ in a terminal.

  • Lint your code with shellcheck.

    To lint a file run shellcheck path/to/ in a terminal. The settings to use are specified in .shellcheckrc, which is automatically read by shellcheck.


The listed formatters and linters offer plugins for many popular text editors and integrated development environments (IDEs). When using these plugins, your code is formatted and linted on the fly, so you don’t have to run the commands yourself.


If you have set up pre-commit, the above formatters and linters check your code before every commit.