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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user