fix: configure lefthook for go lint checks

This commit is contained in:
rishikanthc
2025-12-16 12:29:53 -08:00
committed by Rishikanth Chandrasekaran
parent 658a1a5c49
commit 9146fa075f
2 changed files with 5 additions and 7 deletions

2
go.mod
View File

@@ -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

View File

@@ -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/"