Add pre-commit to the repo

This adds pre-commit which can be used to enforce consistent style
and common errors (like committing large files)
This commit is contained in:
Ian Fijolek
2019-11-21 15:30:19 -08:00
parent b808df7365
commit 9b9f803231
7 changed files with 50 additions and 15 deletions
+10
View File
@@ -29,6 +29,16 @@ test:
@go tool cover -func=coverage.out | awk -v target=80.0% \
'/^total:/ { print "Total coverage: " $$3 " Minimum coverage: " target; if ($$3+0.0 >= target+0.0) print "ok"; else { print "fail"; exit 1; } }'
# Installs pre-commit hooks
.PHONY: install-hooks
install-hooks:
pre-commit install --install-hooks
# Checks files for encryption
.PHONY: check
check:
pre-commit run --all-files
.PHONY: clean
clean:
rm -f ./minitor-go