Avatar Ilya Mateyko

go.astrophena.name/base Module

GitHub repository | Commit (eb6910d)

Base Go packages for my projects.

pre-commit

Install this program:

$ go install go.astrophena.name/base/devtools/pre-commit@latest

Pre-commit installs and runs a Git pre-commit hook.

On its first run in a non-CI environment, it automatically creates the .git/hooks/pre-commit script. This script simply calls 'go tool pre-commit' again, ensuring that the checks are run on every subsequent commit.

Checks are configured through a .devtools.txtar file in the project's root directory. This file is a txtar archive and can contain a pre-commit.json file. The pre-commit.json file should contain a JSON array of check objects, each with the following fields: