ShellCheck: Static analysis for shell scripts

I recently stumbled upon ShellCheck. ShellCheck is a tool to provide static analysis support for your shell scripts. From their website:

ShellCheck is:

  • GPLv3: free as in freedom
  • available on GitHub
  • already packaged for your distro or package manager
  • supported as an integrated linter in major editors
  • available in CodeClimate and Codacy to auto-check your GitHub repo *written in Haskell, if you’re into that sort of thing.

Go and check it out on github and ensure you have static analysis for your shell scripts covered in your CI system of choice.

I’m adding this into NetworkServiceMesh at the moment, as I spent a few hours debugging something which ShellCheck would have caught quickly for me. As a good friend used to say: “If it’s not tested in CI, it’s not working,” Good advice.

More Reading