This project will be archived and you should now use https://github.com/fauust/pre-commit-shell.
Single pre-commit hook which runs shfmt on shell script files (forked from https://github.com/pecigonzalo/pre-commit-shfmt).
.pre-commit-config.yaml
example:
- repo: https://github.com/fauust/pre-commit-fmt
rev: v1.1
hooks:
- id: shell-fmt
args: ["-d", "-i", "2", "-ci"]
The shfmt tool must be installed separately.
For CI systems or if you don't want to install shfmt, you can use the original docker image:
- repo: local
hooks:
- id: docker-shell-shfmt
name: Run shfmt with docker
entry: mvdan/shfmt:latest -d -i 2 -ci
language: docker_image
types: [shell]
Enjoy the clean code!