diff --git a/Makefile b/Makefile index 0e5bc1b7..2c6e9977 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,14 @@ run-envoy: @echo "Starting Envoy..." func-e run --config-path config/envoy.yaml --component-log-level "ext_proc:trace,router:trace,http:trace" +golang-lint-install: + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 + +golang-lint: + @echo "Running golangci-lint..." + @cd src/semantic-router && golangci-lint + + # Run go vet for all Go modules vet: @echo "Running go vet..." @@ -171,7 +179,7 @@ test-semantic-router: build-router cd src/semantic-router && CGO_ENABLED=1 go test -v ./... # Test the Rust library and the Go binding -test: vet check-go-mod-tidy download-models test-binding test-semantic-router +test: vet check-go-mod-tidy golangci-lint download-models test-binding test-semantic-router # Clean built artifacts clean: diff --git a/src/semantic-router/.golangci.yaml b/src/semantic-router/.golangci.yaml new file mode 100644 index 00000000..32faa288 --- /dev/null +++ b/src/semantic-router/.golangci.yaml @@ -0,0 +1,24 @@ +version: "2" +linters: + default: none + enable: + - gosec + - govet + - revive + - unused + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - gosec + path: ^*_test.go +issues: + fix: true +formatters: + enable: + - gofmt \ No newline at end of file