Title: After working with Bash and Shellcheck for a few months, I noticed I could improve my code quality by making it compliant with the Shell Style Guide by Google [0]. While working on that, I thought some aspects of this Shell style guide can be verified automatically, granted some assumptions&#x2F;opinions are formed. So I looked around for linting tools and autoformatters for Bash:<p>Shellcheck: <a href="https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck</a><p>From Asynchronous Lint Engine (ALE): <a href="https:&#x2F;&#x2F;github.com&#x2F;dense-analysis&#x2F;ale&#x2F;blob&#x2F;master&#x2F;supported-tools.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dense-analysis&#x2F;ale&#x2F;blob&#x2F;master&#x2F;supported-...</a><p>- bashate: <a href="https:&#x2F;&#x2F;github.com&#x2F;openstack&#x2F;bashate" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;openstack&#x2F;bashate</a><p>- cspell: <a href="https:&#x2F;&#x2F;github.com&#x2F;streetsidesoftware&#x2F;cspell&#x2F;tree&#x2F;main&#x2F;packages&#x2F;cspell" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;streetsidesoftware&#x2F;cspell&#x2F;tree&#x2F;main&#x2F;packa...</a><p>- Bash Language Server: <a href="https:&#x2F;&#x2F;github.com&#x2F;bash-lsp&#x2F;bash-language-server" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bash-lsp&#x2F;bash-language-server</a><p>- shell -n flag: <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;manual&#x2F;bash.html#index-set" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;manual&#x2F;bash.html#index-set</a><p>- sh(shfmt): <a href="https:&#x2F;&#x2F;github.com&#x2F;mvdan&#x2F;sh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mvdan&#x2F;sh</a><p>- shdoc: <a href="https:&#x2F;&#x2F;github.com&#x2F;reconquest&#x2F;shdoc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;reconquest&#x2F;shdoc</a><p>From this stack post [1]:<p>- checkbashisms: <a href="http:&#x2F;&#x2F;man.he.net&#x2F;man1&#x2F;checkbashisms" rel="nofollow">http:&#x2F;&#x2F;man.he.net&#x2F;man1&#x2F;checkbashisms</a><p>- shlint: <a href="https:&#x2F;&#x2F;github.com&#x2F;duggan&#x2F;shlint" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;duggan&#x2F;shlint</a> (archived)<p>Prettier: <a href="https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=esbenp.prettier-vscode" rel="nofollow">https:&#x2F;&#x2F;marketplace.visualstudio.com&#x2F;items?itemName=esbenp.p...</a><p>Within all these linters and auto-formatters I did not find checks that enforce, for example, the Function Comments of the Shell Style Guide by Google:<p>All function comments should describe the intended API behaviour using:<p><pre><code>    Description of the function.
    Globals: List of global variables used and modified.
    Arguments: Arguments taken.
    Outputs: Output to STDOUT or STDERR.
    Returns: Returned values other than the default exit status of the last command run.
</code></pre>
Hence, I thought we could make a Bash linting tool that verifies compliance with the Shell Style Guide by Google. To do so, a brief start was made here [2]. It identifies&#x2F;lists elements in that style guide that may be verified automatically. Since Bash has been around longer than me, I think there may be some people better suited for the development of this enhanced linter. Hence, I thought it might be wise, for impact and usability, to share this idea here.<p>What do you say, HN?<p>[0]: <a href="https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;shellguide.html" rel="nofollow">https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;shellguide.html</a><p>[1]: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;3668665&#x2F;is-there-a-static-analysis-tool-like-lint-or-perlcritic-for-shell-scripts" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;3668665&#x2F;is-there-a-stati...</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;TruCol&#x2F;checkstyle-for-bash" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;TruCol&#x2F;checkstyle-for-bash</a>
Upvote: