From b23946ce94e785cc7e6a0ea8efdd0496f7920db3 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 15 Mar 2022 10:58:35 +0100 Subject: Makefile: Upgrade gofumpt to v0.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- internal/gitaly/service/smarthttp/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/gitaly/service') 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, -- cgit v1.2.3