Skip to content

Commit 365c022

Browse files
committed
chore: add golangci lint
Signed-off-by: Lan Liang <[email protected]>
1 parent ea63386 commit 365c022

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ run-envoy:
113113
@echo "Starting Envoy..."
114114
func-e run --config-path config/envoy.yaml --component-log-level "ext_proc:trace,router:trace,http:trace"
115115

116+
golang-lint-install:
117+
go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
118+
119+
golang-lint:
120+
@echo "Running golangci-lint..."
121+
@cd src/semantic-router && golangci-lint
122+
123+
116124
# Run go vet for all Go modules
117125
vet:
118126
@echo "Running go vet..."
@@ -171,7 +179,7 @@ test-semantic-router: build-router
171179
cd src/semantic-router && CGO_ENABLED=1 go test -v ./...
172180

173181
# Test the Rust library and the Go binding
174-
test: vet check-go-mod-tidy download-models test-binding test-semantic-router
182+
test: vet check-go-mod-tidy golangci-lint download-models test-binding test-semantic-router
175183

176184
# Clean built artifacts
177185
clean:

src/semantic-router/.golangci.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: "2"
2+
linters:
3+
default: none
4+
enable:
5+
- gosec
6+
- govet
7+
- revive
8+
- unused
9+
exclusions:
10+
generated: lax
11+
presets:
12+
- comments
13+
- common-false-positives
14+
- legacy
15+
- std-error-handling
16+
rules:
17+
- linters:
18+
- gosec
19+
path: ^*_test.go
20+
issues:
21+
fix: true
22+
formatters:
23+
enable:
24+
- gofmt

0 commit comments

Comments
 (0)