From d86223ed5673b7ce21c095dde2d4b593ab21e634 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 9 Sep 2024 11:37:15 +0300 Subject: [PATCH] [#260] Makefile: Add pre-commit targets Signed-off-by: Aleksey Savchuk --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 33ab7d5..a7c027c 100755 --- a/Makefile +++ b/Makefile @@ -77,3 +77,15 @@ help: @echo ' Targets:' @echo '' @awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u + +# 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