diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-15 12:58:35 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-24 16:53:22 +0300 |
commit | b23946ce94e785cc7e6a0ea8efdd0496f7920db3 (patch) | |
tree | 618b806413ff5fcfa57780a4b944efea279b191a | |
parent | 3d27abc33791e4df085fb2fa75b246944671936a (diff) |
Makefile: Upgrade gofumpt to v0.3.1
Upgrade gofumpt to v0.3.1. Besides a very small number of new rules, the
most important benefit is that the new version parallelizes formatting
of files. It is thus much faster, also for our codebase:
$ hyperfine --warmup=1 'make format' 'make format GOFUMPT_VERSION=0.3.0'
Benchmark #1: make format
Time (mean ± σ): 1.238 s ± 0.060 s [User: 1.337 s, System: 0.084 s]
Range (min … max): 1.125 s … 1.312 s 10 runs
Benchmark #2: make format GOFUMPT_VERSION=0.3.0
Time (mean ± σ): 239.5 ms ± 26.0 ms [User: 1.804 s, System: 0.109 s]
Range (min … max): 180.6 ms … 284.7 ms 14 runs
Summary
'make format GOFUMPT_VERSION=0.3.0' ran
5.17 ± 0.61 times faster than 'make format'
Reformat our code with the new version.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | internal/gitaly/service/smarthttp/server.go | 3 | ||||
-rw-r--r-- | internal/praefect/router_per_repository.go | 3 |
3 files changed, 5 insertions, 3 deletions
@@ -73,7 +73,7 @@ GO_BUILD_TAGS := tracer_static,tracer_static_jaeger,tracer_static_stackdrive # Dependency versions GOLANGCI_LINT_VERSION ?= 1.44.2 GOCOVER_COBERTURA_VERSION ?= aaee18c8195c3f2d90e5ef80ca918d265463842a -GOFUMPT_VERSION ?= 0.2.0 +GOFUMPT_VERSION ?= 0.3.1 GOIMPORTS_VERSION ?= 2538eef75904eff384a2551359968e40c207d9d2 GOSUMTEST_VERSION ?= v1.7.0 GO_LICENSES_VERSION ?= 73411c8fa237ccc6a75af79d0a5bc021c9487aad diff --git a/internal/gitaly/service/smarthttp/server.go b/internal/gitaly/service/smarthttp/server.go index 62134032a..e1a3c60d0 100644 --- a/internal/gitaly/service/smarthttp/server.go +++ b/internal/gitaly/service/smarthttp/server.go @@ -18,7 +18,8 @@ type server struct { // NewServer creates a new instance of a grpc SmartHTTPServer func NewServer(locator storage.Locator, gitCmdFactory git.CommandFactory, - cache cache.Streamer, serverOpts ...ServerOpt) gitalypb.SmartHTTPServiceServer { + cache cache.Streamer, serverOpts ...ServerOpt, +) gitalypb.SmartHTTPServiceServer { s := &server{ locator: locator, gitCmdFactory: gitCmdFactory, diff --git a/internal/praefect/router_per_repository.go b/internal/praefect/router_per_repository.go index bd3a37f66..2685829f8 100644 --- a/internal/praefect/router_per_repository.go +++ b/internal/praefect/router_per_repository.go @@ -64,7 +64,8 @@ func NewPerRepositoryRouter( csg datastore.ConsistentStoragesGetter, ag AssignmentGetter, rs datastore.RepositoryStore, - defaultReplicationFactors map[string]int) *PerRepositoryRouter { + defaultReplicationFactors map[string]int, +) *PerRepositoryRouter { return &PerRepositoryRouter{ conns: conns, pg: pg, |