From 3ceada481807d4200228da5c91380d9e4427bce8 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 11 Feb 2026 19:45:25 +0300 Subject: [PATCH] add linter pre-commit hook --- .github/hooks/pre-commit | 8 ++++++++ Makefile | 3 +++ 2 files changed, 11 insertions(+) create mode 100755 .github/hooks/pre-commit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit new file mode 100755 index 00000000..ff950268 --- /dev/null +++ b/.github/hooks/pre-commit @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +if command -v golangci-lint >/dev/null 2>&1; then + golangci-lint run +else + make lint +fi diff --git a/Makefile b/Makefile index b93ddc03..3bfc199a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +hooks: + @cp .github/hooks/* .git/hooks/ + build: GOOS=linux GOARCH=amd64 go build -o ./cmd/mysync/mysync ./cmd/mysync/...