diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bce07a06f..8cc9acaf3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,6 +16,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: + version: v1.59 skip-go-installation: true test: strategy: diff --git a/.golangci.yaml b/.golangci.yaml index 4bd920dce..d5153000c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,14 +1,13 @@ run: timeout: 5m - skip-dirs: - - api/proto output: - format: line-number + formats: + - format: line-number linters: enable-all: false disable-all: true enable: - - vet + - govet - goimports - thelper - tparallel @@ -25,5 +24,7 @@ linters-settings: severity: warning issues: fix: true + exclude-dirs: + - api/proto severity: default-severity: error diff --git a/Makefile b/Makefile index 31505f8a2..4763da11e 100644 --- a/Makefile +++ b/Makefile @@ -80,4 +80,5 @@ setup: go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.5.0 go get github.com/bufbuild/buf/cmd/buf@v1.15.1 go get github.com/vektra/mockery/v2@v2.33.0 + go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59 \ No newline at end of file diff --git a/core/appeal/service_test.go b/core/appeal/service_test.go index 7c0dbc17e..d602127db 100644 --- a/core/appeal/service_test.go +++ b/core/appeal/service_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "net/http" "net/http/httptest" "testing" @@ -25,7 +26,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "io" ) var ( @@ -4411,7 +4411,6 @@ func (s *ServiceTestSuite) TestPatch() { }) } }) - } func (s *ServiceTestSuite) TestUpdateApproval() { diff --git a/internal/store/postgres/model/grant.go b/internal/store/postgres/model/grant.go index d26b8d725..4592e5420 100644 --- a/internal/store/postgres/model/grant.go +++ b/internal/store/postgres/model/grant.go @@ -103,7 +103,6 @@ func (m *Grant) FromDomain(g domain.Grant) error { Time: *g.RestoredAt, Valid: true, } - } m.Status = string(g.Status) diff --git a/pkg/http/http.go b/pkg/http/http.go index 23317866c..9a0a83e27 100644 --- a/pkg/http/http.go +++ b/pkg/http/http.go @@ -5,12 +5,13 @@ import ( "context" "encoding/base64" "fmt" + "net/http" + validator "github.com/go-playground/validator/v10" defaults "github.com/mcuadros/go-defaults" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/idtoken" - "net/http" ) type HTTPAuthConfig struct { diff --git a/pkg/http/http_test.go b/pkg/http/http_test.go index 6a67c1bf6..d7d0059b0 100644 --- a/pkg/http/http_test.go +++ b/pkg/http/http_test.go @@ -4,12 +4,13 @@ import ( "context" "encoding/base64" "fmt" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "io/ioutil" "net/http" "net/http/httptest" "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" ) func TestMakeRequestForGet(t *testing.T) {