pre-commit: Add shellcheck to pre-commit configuration.

`Shellcheck` is a linter tool for shell scripts that is also used in
Automation Hub.

This change adds a pre-commit hook to run shellcheck on shell scripts.
The hook uses a Docker image, which needs to be downloaded on the first
run. It works well  with `podman`.
This commit is contained in:
Rafael Guterres Jeffman
2021-11-23 16:21:43 -03:00
parent 77b72af1a2
commit 93a441494d

View File

@@ -38,3 +38,8 @@ repos:
entry: utils/ansible-doc-test
# args: ['-v', 'roles', 'plugins']
files: ^.*.py$
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
args: ["--severity=warning"] # Only show errors and warnings