[#124] Makefile: Add pre-commit related targets

Add the following targets:
- `pre-commit` to install pre-commit hooks
- `unpre-commit` to uninstall pre-commit hooks
- `pre-commit-run` to run pre-commit hooks

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
Aleksey Savchuk 2024-10-16 17:54:43 +03:00
parent af7db13d51
commit 88789d5f4a
Signed by: a-savchuk
GPG key ID: 70C0A7FF6F9C4639

View file

@ -120,6 +120,21 @@ lint:
$(LINT_DIR)/golangci-lint run $(LINT_DIR)/golangci-lint run
.PHONY: pre-commit unpre-commit pre-commit-run
# Activate pre-commit hooks
pre-commit:
pre-commit install --hook-type pre-commit
# Deactivate pre-commit hooks
unpre-commit:
pre-commit uninstall --hook-type pre-commit
# Run pre-commit hooks
pre-commit-run:
@pre-commit run --all-files --hook-stage manual
# Print version # Print version
version: version:
@echo $(VERSION) @echo $(VERSION)