3 ms·
Add shellcheck and shfmt to your pre-commit hooks. The easiest way to do so is with the shellcheck-py and shfmt-py wrappers: https://pypi.org/project/shellchec
by js2 3y ago
Add shellcheck and shfmt to your pre-commit hooks. The easiest way to do so is with the shellcheck-py and shfmt-py wrappers:
https://pypi.org/project/shellcheck-py/ https://pypi.org/project/shellcheck-py/
https://pypi.org/project/shfmt-py/ https://pypi.org/project/shfmt-py/
- c-hendricks 3y agoThe easiest way is probably winget install shellcheck shfmt brew install shellcheck shfmt
- js2 3y agoI'm referring to using these tools with https://pre-commit.com https://pre-commit.com. The wrappers work cross-platform and don't require folks interacting with the repo to install anything besides pre-commit itself and then running "pre-commit install" in the repo. The first time pre-commit is run, it then downloads and installs all of the hooks. The wrappers also work well with CI systems if you want to enforce the pre-commit hooks in PRs. Another advantage is that everyone interacting with the repo will be using the same versions of the tools. If you're not using these tools with pre-commit, then sure, install them directly via your package manager of choice.