From 88789d5f4a61627a3027018fefecd0689ab62af6 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 16 Oct 2024 17:54:43 +0300 Subject: [PATCH] [#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 --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 6176316..edc7916 100755 --- a/Makefile +++ b/Makefile @@ -120,6 +120,21 @@ lint: $(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 version: @echo $(VERSION)