mvdan / sh

A shell parser, formatter, and interpreter with bash support; includes shfmt
https://pkg.go.dev/mvdan.cc/sh/v3
BSD 3-Clause "New" or "Revised" License
7.16k stars 338 forks source link

Add example for docker-based pre-commit hook #752

Closed wwuck closed 2 years ago

wwuck commented 2 years ago

This adds an example for running shfmt in a local pre-commit hook using the official shfmt docker image for cases where golang is not installed.

wwuck commented 2 years ago

Yes, I should add a pin on specific tag in the example. Anyone using this would have to upgrade the tag manually for each new release as pre-commit autoupdate won't do that automatically here.