diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-24 11:10:38 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-24 11:10:38 +0300 |
commit | 2bb4f2314215873901f008ca8520370a117fff41 (patch) | |
tree | 1bf4e53629add7c24845b5a627c98985236854ce | |
parent | 56b0b20253ee17e1f2e423360b6596ebcafb8307 (diff) | |
parent | 88405e3c245c3c6828c35174f123d8a333e3cd0d (diff) |
Merge branch 'pks-backup-formatting' into 'master'
Improve formatting rules
See merge request gitlab-org/gitaly!4126
-rw-r--r-- | .golangci.yml | 3 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | internal/backup/pipeline_test.go | 12 | ||||
-rw-r--r-- | internal/gitlab/http_client_test.go | 1 | ||||
-rw-r--r-- | internal/praefect/nodes/health_manager_test.go | 1 |
5 files changed, 10 insertions, 9 deletions
diff --git a/.golangci.yml b/.golangci.yml index 584ba2bf9..efb740563 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,9 @@ linters: - exportloopref - depguard - gci + # We use both gofmt and gofumpt because gofumpt doesn't seem to be linting + # for simplifications, while gofmt does. + - gofmt - gofumpt - goimports - gosimple @@ -70,7 +70,7 @@ GO_BUILD_TAGS := tracer_static,tracer_static_jaeger,tracer_static_stackdrive # Dependency versions GOLANGCI_LINT_VERSION ?= 1.43.0 GOCOVER_COBERTURA_VERSION ?= aaee18c8195c3f2d90e5ef80ca918d265463842a -GOFUMPT_VERSION ?= 0.1.1 +GOFUMPT_VERSION ?= 0.2.0 GOIMPORTS_VERSION ?= 2538eef75904eff384a2551359968e40c207d9d2 GO_JUNIT_REPORT_VERSION ?= 984a47ca6b0a7d704c4b589852051b4d7865aa17 GO_LICENSES_VERSION ?= 73411c8fa237ccc6a75af79d0a5bc021c9487aad diff --git a/internal/backup/pipeline_test.go b/internal/backup/pipeline_test.go index 6623fadd6..44a90afb7 100644 --- a/internal/backup/pipeline_test.go +++ b/internal/backup/pipeline_test.go @@ -189,9 +189,9 @@ func TestPipelineError(t *testing.T) { { name: "with gl_project_path", repos: []*gitalypb.Repository{ - &gitalypb.Repository{RelativePath: "1.git", GlProjectPath: "Projects/Apple"}, - &gitalypb.Repository{RelativePath: "2.git", GlProjectPath: "Projects/Banana"}, - &gitalypb.Repository{RelativePath: "3.git", GlProjectPath: "Projects/Carrot"}, + {RelativePath: "1.git", GlProjectPath: "Projects/Apple"}, + {RelativePath: "2.git", GlProjectPath: "Projects/Banana"}, + {RelativePath: "3.git", GlProjectPath: "Projects/Carrot"}, }, expectedError: `3 failures encountered: - 1.git (Projects/Apple): assert.AnError general error for testing @@ -202,9 +202,9 @@ func TestPipelineError(t *testing.T) { { name: "without gl_project_path", repos: []*gitalypb.Repository{ - &gitalypb.Repository{RelativePath: "1.git"}, - &gitalypb.Repository{RelativePath: "2.git"}, - &gitalypb.Repository{RelativePath: "3.git"}, + {RelativePath: "1.git"}, + {RelativePath: "2.git"}, + {RelativePath: "3.git"}, }, expectedError: `3 failures encountered: - 1.git: assert.AnError general error for testing diff --git a/internal/gitlab/http_client_test.go b/internal/gitlab/http_client_test.go index 8ce8be5e0..12b7eaecf 100644 --- a/internal/gitlab/http_client_test.go +++ b/internal/gitlab/http_client_test.go @@ -262,7 +262,6 @@ func TestAccess_allowedResponseHandling(t *testing.T) { allowed bool errMsg string }{ - { desc: "allowed", allowedHandler: func(w http.ResponseWriter, r *http.Request) { diff --git a/internal/praefect/nodes/health_manager_test.go b/internal/praefect/nodes/health_manager_test.go index 9ca498ab9..b0a7a7a15 100644 --- a/internal/praefect/nodes/health_manager_test.go +++ b/internal/praefect/nodes/health_manager_test.go @@ -280,7 +280,6 @@ func TestHealthManager(t *testing.T) { { desc: "majority consensus healthy", healthChecks: HealthChecks{ - { PraefectName: "praefect-1", LocalStatus: LocalStatus{ |