From 9146fa075f92bc2ecaff85c0f2f34e87d14b5ac7 Mon Sep 17 00:00:00 2001 From: rishikanthc Date: Tue, 16 Dec 2025 12:29:53 -0800 Subject: [PATCH] fix: configure lefthook for go lint checks --- go.mod | 2 +- lefthook.yml | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 5f7e74fc..fb5ec5d5 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/swaggo/swag v1.16.6 golang.org/x/crypto v0.41.0 golang.org/x/sync v0.17.0 + golang.org/x/text v0.29.0 gorm.io/gorm v1.30.1 ) @@ -72,7 +73,6 @@ require ( golang.org/x/mod v0.27.0 // indirect golang.org/x/net v0.43.0 // indirect golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.29.0 // indirect golang.org/x/tools v0.36.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/lefthook.yml b/lefthook.yml index 07e66ad2..704a3ba8 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,13 +1,11 @@ # lefthook.yml pre-commit: + parallel: true commands: - # We run this first so the linter checks the final code structure. - frontend-format: - root: "web/frontend/" # REPLACE with your actual folder name - glob: "**/*.{js,jsx,ts,tsx,json,css,scss,md}" - run: npx prettier --write {staged_files} - stage_fixed: true + go-lint: + glob: "**/*.go" + run: golangci-lint run --new-from-rev=HEAD~ {staged_files} frontend-lint: root: "web/frontend/"