diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2022-01-24 06:40:50 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-01-24 06:40:50 +0300 |
commit | 88656e8f55e74ea5d7adf703e36dac23726a139b (patch) | |
tree | 2cdffe4aeedc110617889f5d89209ccc5895b0a1 | |
parent | 1e53ac8e60a17823a47f4af5db19cb00365bf7dd (diff) | |
parent | d190b1892e134dec2556c543469962427c667cb7 (diff) |
Merge branch 'feat/gci' into 'master'
build: add gci linter
Closes #671
See merge request gitlab-org/gitlab-pages!643
-rw-r--r-- | .golangci.yml | 1 | ||||
-rw-r--r-- | app.go | 3 | ||||
-rw-r--r-- | internal/acme/middleware.go | 1 | ||||
-rw-r--r-- | internal/auth/auth.go | 3 | ||||
-rw-r--r-- | internal/handlers/handlers_test.go | 4 | ||||
-rw-r--r-- | internal/httpfs/http_fs_test.go | 4 | ||||
-rw-r--r-- | internal/httptransport/metered_round_tripper_test.go | 1 | ||||
-rw-r--r-- | internal/redirects/redirects.go | 1 | ||||
-rw-r--r-- | internal/source/gitlab/client/client.go | 1 | ||||
-rw-r--r-- | internal/vfs/zip/archive.go | 3 | ||||
-rw-r--r-- | internal/vfs/zip/vfs_test.go | 5 | ||||
-rw-r--r-- | test/acceptance/ratelimiter_test.go | 4 | ||||
-rw-r--r-- | test/acceptance/redirects_test.go | 4 |
13 files changed, 15 insertions, 20 deletions
diff --git a/.golangci.yml b/.golangci.yml index 5916cb9b..368ab567 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,6 +44,7 @@ linters: - bodyclose - deadcode - dogsled + - gci - goconst - gocyclo - goimports @@ -16,11 +16,10 @@ import ( ghandlers "github.com/gorilla/handlers" "github.com/hashicorp/go-multierror" "github.com/rs/cors" - "gitlab.com/gitlab-org/labkit/log" - "gitlab.com/gitlab-org/go-mimedb" "gitlab.com/gitlab-org/labkit/correlation" "gitlab.com/gitlab-org/labkit/errortracking" + "gitlab.com/gitlab-org/labkit/log" labmetrics "gitlab.com/gitlab-org/labkit/metrics" "gitlab.com/gitlab-org/labkit/monitoring" diff --git a/internal/acme/middleware.go b/internal/acme/middleware.go index 988e63b7..6fe5cc82 100644 --- a/internal/acme/middleware.go +++ b/internal/acme/middleware.go @@ -2,6 +2,7 @@ package acme import ( "net/http" + // TODO: break this dependency too https://gitlab.com/gitlab-org/gitlab-pages/-/issues/650 domainCfg "gitlab.com/gitlab-org/gitlab-pages/internal/domain" ) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index acef051b..2f0395df 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -17,9 +17,8 @@ import ( "github.com/gorilla/securecookie" "github.com/gorilla/sessions" "github.com/sirupsen/logrus" - "golang.org/x/crypto/hkdf" - "gitlab.com/gitlab-org/labkit/errortracking" + "golang.org/x/crypto/hkdf" "gitlab.com/gitlab-org/gitlab-pages/internal/httperrors" "gitlab.com/gitlab-org/gitlab-pages/internal/httptransport" diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index d71e9b91..dd940251 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -7,10 +7,10 @@ import ( "net/url" "testing" - "gitlab.com/gitlab-org/gitlab-pages/internal/mocks" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/mocks" ) func TestNotHandleArtifactRequestReturnsFalse(t *testing.T) { diff --git a/internal/httpfs/http_fs_test.go b/internal/httpfs/http_fs_test.go index ce404a11..991c6017 100644 --- a/internal/httpfs/http_fs_test.go +++ b/internal/httpfs/http_fs_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "gitlab.com/gitlab-org/gitlab-pages/internal/httptransport" - "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/httptransport" ) func TestFSOpen(t *testing.T) { diff --git a/internal/httptransport/metered_round_tripper_test.go b/internal/httptransport/metered_round_tripper_test.go index 147cfdba..2b126760 100644 --- a/internal/httptransport/metered_round_tripper_test.go +++ b/internal/httptransport/metered_round_tripper_test.go @@ -9,7 +9,6 @@ import ( "time" "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/stretchr/testify/require" ) diff --git a/internal/redirects/redirects.go b/internal/redirects/redirects.go index 11a85d66..f3c4e491 100644 --- a/internal/redirects/redirects.go +++ b/internal/redirects/redirects.go @@ -11,7 +11,6 @@ import ( "strings" netlifyRedirects "github.com/tj/go-redirects" - "gitlab.com/gitlab-org/labkit/log" "gitlab.com/gitlab-org/gitlab-pages/internal/vfs" diff --git a/internal/source/gitlab/client/client.go b/internal/source/gitlab/client/client.go index 9e822e56..60a8c650 100644 --- a/internal/source/gitlab/client/client.go +++ b/internal/source/gitlab/client/client.go @@ -12,7 +12,6 @@ import ( "time" "github.com/golang-jwt/jwt/v4" - "gitlab.com/gitlab-org/labkit/correlation" "gitlab.com/gitlab-org/gitlab-pages/internal/config" diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go index 551d10c0..b773899c 100644 --- a/internal/vfs/zip/archive.go +++ b/internal/vfs/zip/archive.go @@ -13,8 +13,7 @@ import ( "sync/atomic" "time" - // TODO: Revert back to zip/archive once we no longer support go1.17 - // https://gitlab.com/gitlab-org/gitlab-pages/-/issues/673 + // TODO: Revert back to zip/archive once we no longer support go1.17 (https://gitlab.com/gitlab-org/gitlab-pages/-/issues/673) zip "gitlab.com/gitlab-org/golang-archive-zip" "gitlab.com/gitlab-org/labkit/log" diff --git a/internal/vfs/zip/vfs_test.go b/internal/vfs/zip/vfs_test.go index eaa2352d..98660719 100644 --- a/internal/vfs/zip/vfs_test.go +++ b/internal/vfs/zip/vfs_test.go @@ -7,12 +7,11 @@ import ( "testing" "time" - "gitlab.com/gitlab-org/gitlab-pages/internal/config" - "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" - "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitlab-pages/internal/config" + "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" "gitlab.com/gitlab-org/gitlab-pages/metrics" ) diff --git a/test/acceptance/ratelimiter_test.go b/test/acceptance/ratelimiter_test.go index 037eef96..02ba54f5 100644 --- a/test/acceptance/ratelimiter_test.go +++ b/test/acceptance/ratelimiter_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitlab-pages/internal/feature" "gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers" - - "github.com/stretchr/testify/require" ) var ratelimitedListeners = map[string]struct { diff --git a/test/acceptance/redirects_test.go b/test/acceptance/redirects_test.go index 685e0fcb..6c1158a4 100644 --- a/test/acceptance/redirects_test.go +++ b/test/acceptance/redirects_test.go @@ -6,9 +6,9 @@ import ( "net/http" "testing" - "gitlab.com/gitlab-org/gitlab-pages/internal/feature" - "github.com/stretchr/testify/require" + + "gitlab.com/gitlab-org/gitlab-pages/internal/feature" ) func TestRedirectStatusPage(t *testing.T) { |