Skip to content

Commit 4325323

Browse files
author
Karthik Nayak
committed
lint: Remove space after nolint:
With recent changes `gofmt` [1] started reformatting godoc comments. This causes a problem wherein it reformats `//nolint: staticcheck` to `// nolint: staticcheck`. But it does ignore directives [2]. So let's change all our nolint to directive format. This avoids the conflict with `gofmt`. This fix was done by running: `grep -r --include="*.go" -E "//nolint: .*" -l | xargs sed -i 's/nolint: stylecheck/nolint:stylecheck/g'` as such, we can skip it from review. [1]: golangci/golangci-lint#1658 (comment) [2]: golangci/golangci-lint#3098 (comment)
1 parent 857a17a commit 4325323

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+106
-106
lines changed

auth/token.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
var (
21-
//nolint: gochecknoglobals
21+
//nolint:gochecknoglobals
2222
// This infrastructure is required for testing purposes and there is no
2323
// proper place to put it instead. While we could move it into the
2424
// config, we certainly don't want to make it configurable for now, so

client/pool_options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type poolOptions struct {
77
dialOptions []grpc.DialOption
88
}
99

10-
//nolint: stylecheck // This is unintentionally missing documentation.
10+
//nolint:stylecheck // This is unintentionally missing documentation.
1111
type PoolOption func(*poolOptions)
1212

1313
func applyPoolOptions(options []PoolOption) *poolOptions {

internal/cgroups/noop.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ import (
99
// NoopManager is a cgroups manager that does nothing
1010
type NoopManager struct{}
1111

12-
//nolint: stylecheck // This is unintentionally missing documentation.
12+
//nolint:stylecheck // This is unintentionally missing documentation.
1313
func (cg *NoopManager) Setup() error {
1414
return nil
1515
}
1616

17-
//nolint: stylecheck // This is unintentionally missing documentation.
17+
//nolint:stylecheck // This is unintentionally missing documentation.
1818
func (cg *NoopManager) AddCommand(cmd *command.Command, repo repository.GitRepo) (string, error) {
1919
return "", nil
2020
}
2121

22-
//nolint: stylecheck // This is unintentionally missing documentation.
22+
//nolint:stylecheck // This is unintentionally missing documentation.
2323
func (cg *NoopManager) Cleanup() error {
2424
return nil
2525
}

internal/cgroups/v1_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func newV1Manager(cfg cgroupscfg.Config, pid int) *CGroupV1Manager {
5656
}
5757
}
5858

59-
//nolint: stylecheck // This is unintentionally missing documentation.
59+
//nolint:stylecheck // This is unintentionally missing documentation.
6060
func (cg *CGroupV1Manager) Setup() error {
6161
var parentResources specs.LinuxResources
6262

@@ -200,7 +200,7 @@ func (cg *CGroupV1Manager) Describe(ch chan<- *prometheus.Desc) {
200200
prometheus.DescribeByCollect(cg, ch)
201201
}
202202

203-
//nolint: stylecheck // This is unintentionally missing documentation.
203+
//nolint:stylecheck // This is unintentionally missing documentation.
204204
func (cg *CGroupV1Manager) Cleanup() error {
205205
processCgroupPath := cg.currentProcessCgroup()
206206

internal/command/stats.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99

1010
type requestStatsKey struct{}
1111

12-
//nolint: stylecheck // This is unintentionally missing documentation.
12+
//nolint:stylecheck // This is unintentionally missing documentation.
1313
type Stats struct {
1414
registry map[string]int
1515
sync.Mutex
1616
}
1717

18-
//nolint: stylecheck // This is unintentionally missing documentation.
18+
//nolint:stylecheck // This is unintentionally missing documentation.
1919
func (stats *Stats) RecordSum(key string, value int) {
2020
stats.Lock()
2121
defer stats.Unlock()
@@ -27,7 +27,7 @@ func (stats *Stats) RecordSum(key string, value int) {
2727
stats.registry[key] = value
2828
}
2929

30-
//nolint: stylecheck // This is unintentionally missing documentation.
30+
//nolint:stylecheck // This is unintentionally missing documentation.
3131
func (stats *Stats) RecordMax(key string, value int) {
3232
stats.Lock()
3333
defer stats.Unlock()
@@ -41,7 +41,7 @@ func (stats *Stats) RecordMax(key string, value int) {
4141
stats.registry[key] = value
4242
}
4343

44-
//nolint: stylecheck // This is unintentionally missing documentation.
44+
//nolint:stylecheck // This is unintentionally missing documentation.
4545
func (stats *Stats) Fields() logrus.Fields {
4646
stats.Lock()
4747
defer stats.Unlock()
@@ -53,13 +53,13 @@ func (stats *Stats) Fields() logrus.Fields {
5353
return f
5454
}
5555

56-
//nolint: stylecheck // This is unintentionally missing documentation.
56+
//nolint:stylecheck // This is unintentionally missing documentation.
5757
func StatsFromContext(ctx context.Context) *Stats {
5858
stats, _ := ctx.Value(requestStatsKey{}).(*Stats)
5959
return stats
6060
}
6161

62-
//nolint: stylecheck // This is unintentionally missing documentation.
62+
//nolint:stylecheck // This is unintentionally missing documentation.
6363
func InitContextStats(ctx context.Context) context.Context {
6464
return context.WithValue(ctx, requestStatsKey{}, &Stats{
6565
registry: make(map[string]int),

internal/git/stats/packfile_negotiation.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"gitlab.com/gitlab-org/gitaly/v15/internal/helper/text"
1212
)
1313

14-
//nolint: stylecheck // This is unintentionally missing documentation.
14+
//nolint:stylecheck // This is unintentionally missing documentation.
1515
type PackfileNegotiation struct {
1616
// Total size of all pktlines' data
1717
PayloadSize int64
@@ -31,7 +31,7 @@ type PackfileNegotiation struct {
3131
Filter string
3232
}
3333

34-
//nolint: stylecheck // This is unintentionally missing documentation.
34+
//nolint:stylecheck // This is unintentionally missing documentation.
3535
func ParsePackfileNegotiation(body io.Reader) (PackfileNegotiation, error) {
3636
n := PackfileNegotiation{}
3737
return n, n.Parse(body)

internal/gitaly/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type Hooks struct {
9292
CustomHooksDir string `toml:"custom_hooks_dir" json:"custom_hooks_dir"`
9393
}
9494

95-
//nolint: stylecheck // This is unintentionally missing documentation.
95+
//nolint:stylecheck // This is unintentionally missing documentation.
9696
type HTTPSettings struct {
9797
ReadTimeout int `toml:"read_timeout" json:"read_timeout"`
9898
User string `toml:"user" json:"user"`

internal/gitaly/hook/check.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"gitlab.com/gitlab-org/gitaly/v15/internal/gitlab"
77
)
88

9-
//nolint: stylecheck // This is unintentionally missing documentation.
9+
//nolint:stylecheck // This is unintentionally missing documentation.
1010
func (m *GitLabHookManager) Check(ctx context.Context) (*gitlab.CheckInfo, error) {
1111
return m.gitlabClient.Check(ctx)
1212
}

internal/gitaly/hook/postreceive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func printAlert(m gitlab.PostReceiveMessage, w io.Writer) error {
116116
return nil
117117
}
118118

119-
//nolint: stylecheck // This is unintentionally missing documentation.
119+
//nolint:stylecheck // This is unintentionally missing documentation.
120120
func (m *GitLabHookManager) PostReceiveHook(ctx context.Context, repo *gitalypb.Repository, pushOptions, env []string, stdin io.Reader, stdout, stderr io.Writer) error {
121121
payload, err := git.HooksPayloadFromEnv(env)
122122
if err != nil {

internal/gitaly/hook/referencetransaction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
// reference without checking its current value.
1717
var forceDeletionPrefix = fmt.Sprintf("%[1]s %[1]s ", git.ObjectHashSHA1.ZeroOID.String())
1818

19-
//nolint: stylecheck // This is unintentionally missing documentation.
19+
//nolint:stylecheck // This is unintentionally missing documentation.
2020
func (m *GitLabHookManager) ReferenceTransactionHook(ctx context.Context, state ReferenceTransactionState, env []string, stdin io.Reader) error {
2121
payload, err := git.HooksPayloadFromEnv(env)
2222
if err != nil {

internal/gitaly/hook/update.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
1212
)
1313

14-
//nolint: stylecheck // This is unintentionally missing documentation.
14+
//nolint:stylecheck // This is unintentionally missing documentation.
1515
func (m *GitLabHookManager) UpdateHook(ctx context.Context, repo *gitalypb.Repository, ref, oldValue, newValue string, env []string, stdout, stderr io.Writer) error {
1616
payload, err := git.HooksPayloadFromEnv(env)
1717
if err != nil {

internal/gitaly/service/operations/apply_patch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (er gitError) Error() string {
3333
return er.ErrMsg + ": " + er.Err.Error()
3434
}
3535

36-
//nolint: stylecheck // This is unintentionally missing documentation.
36+
//nolint:stylecheck // This is unintentionally missing documentation.
3737
func (s *Server) UserApplyPatch(stream gitalypb.OperationService_UserApplyPatchServer) error {
3838
firstRequest, err := stream.Recv()
3939
if err != nil {

internal/gitaly/service/operations/branches.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"google.golang.org/grpc/status"
1414
)
1515

16-
//nolint: stylecheck // This is unintentionally missing documentation.
16+
//nolint:stylecheck // This is unintentionally missing documentation.
1717
func (s *Server) UserCreateBranch(ctx context.Context, req *gitalypb.UserCreateBranchRequest) (*gitalypb.UserCreateBranchResponse, error) {
1818
if len(req.BranchName) == 0 {
1919
return nil, status.Errorf(codes.InvalidArgument, "Bad Request (empty branch name)")
@@ -117,7 +117,7 @@ func validateUserUpdateBranchGo(req *gitalypb.UserUpdateBranchRequest) error {
117117
return nil
118118
}
119119

120-
//nolint: stylecheck // This is unintentionally missing documentation.
120+
//nolint:stylecheck // This is unintentionally missing documentation.
121121
func (s *Server) UserUpdateBranch(ctx context.Context, req *gitalypb.UserUpdateBranchRequest) (*gitalypb.UserUpdateBranchResponse, error) {
122122
// Validate the request
123123
if err := validateUserUpdateBranchGo(req); err != nil {

internal/gitaly/service/operations/cherry_pick.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"google.golang.org/grpc/status"
1717
)
1818

19-
//nolint: stylecheck // This is unintentionally missing documentation.
19+
//nolint:stylecheck // This is unintentionally missing documentation.
2020
func (s *Server) UserCherryPick(ctx context.Context, req *gitalypb.UserCherryPickRequest) (*gitalypb.UserCherryPickResponse, error) {
2121
if err := validateCherryPickOrRevertRequest(req); err != nil {
2222
return nil, status.Errorf(codes.InvalidArgument, "UserCherryPick: %v", err)

internal/gitaly/service/operations/merge.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func validateMergeBranchRequest(request *gitalypb.UserMergeBranchRequest) error
4444
return nil
4545
}
4646

47-
//nolint: stylecheck // This is unintentionally missing documentation.
47+
//nolint:stylecheck // This is unintentionally missing documentation.
4848
func (s *Server) UserMergeBranch(stream gitalypb.OperationService_UserMergeBranchServer) error {
4949
ctx := stream.Context()
5050

@@ -243,7 +243,7 @@ func validateFFRequest(in *gitalypb.UserFFBranchRequest) error {
243243
return nil
244244
}
245245

246-
//nolint: stylecheck // This is unintentionally missing documentation.
246+
//nolint:stylecheck // This is unintentionally missing documentation.
247247
func (s *Server) UserFFBranch(ctx context.Context, in *gitalypb.UserFFBranchRequest) (*gitalypb.UserFFBranchResponse, error) {
248248
if err := validateFFRequest(in); err != nil {
249249
return nil, helper.ErrInvalidArgument(err)

internal/gitaly/service/operations/rebase.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"google.golang.org/grpc/status"
1515
)
1616

17-
//nolint: stylecheck // This is unintentionally missing documentation.
17+
//nolint:stylecheck // This is unintentionally missing documentation.
1818
func (s *Server) UserRebaseConfirmable(stream gitalypb.OperationService_UserRebaseConfirmableServer) error {
1919
firstRequest, err := stream.Recv()
2020
if err != nil {

internal/gitaly/service/operations/revert.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
1515
)
1616

17-
//nolint: stylecheck // This is unintentionally missing documentation.
17+
//nolint:stylecheck // This is unintentionally missing documentation.
1818
func (s *Server) UserRevert(ctx context.Context, req *gitalypb.UserRevertRequest) (*gitalypb.UserRevertResponse, error) {
1919
if err := validateCherryPickOrRevertRequest(req); err != nil {
2020
return nil, helper.ErrInvalidArgument(err)

internal/gitaly/service/operations/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
1919
)
2020

21-
//nolint: stylecheck // This is unintentionally missing documentation.
21+
//nolint:stylecheck // This is unintentionally missing documentation.
2222
type Server struct {
2323
gitalypb.UnimplementedOperationServiceServer
2424
hookManager hook.Manager

internal/gitaly/service/operations/submodules.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
const userUpdateSubmoduleName = "UserUpdateSubmodule"
2121

22-
//nolint: stylecheck // This is unintentionally missing documentation.
22+
//nolint:stylecheck // This is unintentionally missing documentation.
2323
func (s *Server) UserUpdateSubmodule(ctx context.Context, req *gitalypb.UserUpdateSubmoduleRequest) (*gitalypb.UserUpdateSubmoduleResponse, error) {
2424
if err := validateUserUpdateSubmoduleRequest(req); err != nil {
2525
return nil, status.Errorf(codes.InvalidArgument, userUpdateSubmoduleName+": %v", err)

internal/gitaly/service/operations/tags.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"google.golang.org/grpc/status"
2020
)
2121

22-
//nolint: stylecheck // This is unintentionally missing documentation.
22+
//nolint:stylecheck // This is unintentionally missing documentation.
2323
func (s *Server) UserDeleteTag(ctx context.Context, req *gitalypb.UserDeleteTagRequest) (*gitalypb.UserDeleteTagResponse, error) {
2424
if len(req.TagName) == 0 {
2525
return nil, status.Errorf(codes.InvalidArgument, "empty tag name")
@@ -82,7 +82,7 @@ func validateUserCreateTag(req *gitalypb.UserCreateTagRequest) error {
8282
return nil
8383
}
8484

85-
//nolint: stylecheck // This is unintentionally missing documentation.
85+
//nolint:stylecheck // This is unintentionally missing documentation.
8686
func (s *Server) UserCreateTag(ctx context.Context, req *gitalypb.UserCreateTagRequest) (*gitalypb.UserCreateTagResponse, error) {
8787
if err := validateUserCreateTag(req); err != nil {
8888
return nil, helper.ErrInvalidArgumentf("validating request: %w", err)

internal/gitaly/service/smarthttp/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func NewServer(
4747
// ServerOpt is a self referential option for server
4848
type ServerOpt func(s *server)
4949

50-
//nolint: stylecheck // This is unintentionally missing documentation.
50+
//nolint:stylecheck // This is unintentionally missing documentation.
5151
func WithPackfileNegotiationMetrics(c *prometheus.CounterVec) ServerOpt {
5252
return func(s *server) {
5353
s.packfileNegotiationMetrics = c

internal/gitaly/service/ssh/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func WithArchiveRequestTimeout(d time.Duration) ServerOpt {
6868
}
6969
}
7070

71-
//nolint: stylecheck // This is unintentionally missing documentation.
71+
//nolint:stylecheck // This is unintentionally missing documentation.
7272
func WithPackfileNegotiationMetrics(c *prometheus.CounterVec) ServerOpt {
7373
return func(s *server) {
7474
s.packfileNegotiationMetrics = c

internal/gitaly/storage/locator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type Locator interface {
3434
StateDir(storageName string) (string, error)
3535
}
3636

37-
//nolint: stylecheck // This is unintentionally missing documentation.
37+
//nolint:stylecheck // This is unintentionally missing documentation.
3838
var ErrRelativePathEscapesRoot = errors.New("relative path escapes root directory")
3939

4040
// ValidateRelativePath validates a relative path by joining it with rootDir and verifying the result

internal/helper/ticker.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ type ManualTicker struct {
4747
ResetFunc func()
4848
}
4949

50-
//nolint: stylecheck // This is unintentionally missing documentation.
50+
//nolint:stylecheck // This is unintentionally missing documentation.
5151
func (mt *ManualTicker) C() <-chan time.Time { return mt.c }
5252

53-
//nolint: stylecheck // This is unintentionally missing documentation.
53+
//nolint:stylecheck // This is unintentionally missing documentation.
5454
func (mt *ManualTicker) Stop() { mt.StopFunc() }
5555

56-
//nolint: stylecheck // This is unintentionally missing documentation.
56+
//nolint:stylecheck // This is unintentionally missing documentation.
5757
func (mt *ManualTicker) Reset() { mt.ResetFunc() }
5858

59-
//nolint: stylecheck // This is unintentionally missing documentation.
59+
//nolint:stylecheck // This is unintentionally missing documentation.
6060
func (mt *ManualTicker) Tick() { mt.c <- time.Now() }
6161

6262
// NewManualTicker returns a Ticker that can be manually controlled.

internal/middleware/featureflag/featureflag_handler_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ func TestStreamInterceptor(t *testing.T) {
4747
}
4848

4949
func callUnary(ctx context.Context) {
50-
//nolint: errcheck
50+
//nolint:errcheck
5151
UnaryInterceptor(ctx, nil, nil, func(context.Context, interface{}) (interface{}, error) {
5252
ctxlogrus.Extract(ctx).Info("verify")
5353
return nil, nil
5454
})
5555
}
5656

5757
func callStream(ctx context.Context) {
58-
//nolint: errcheck
58+
//nolint:errcheck
5959
StreamInterceptor(ctx, &grpcmw.WrappedServerStream{WrappedContext: ctx}, nil, func(interface{}, grpc.ServerStream) error {
6060
ctxlogrus.Extract(ctx).Info("verify")
6161
return nil

internal/praefect/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const (
4141
minimalSyncRunInterval = time.Minute
4242
)
4343

44-
//nolint: stylecheck // This is unintentionally missing documentation.
44+
//nolint:stylecheck // This is unintentionally missing documentation.
4545
type Failover struct {
4646
Enabled bool `toml:"enabled,omitempty"`
4747
// ElectionStrategy is the strategy to use for electing primaries nodes.

internal/praefect/config/node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Node struct {
1212
Token string `toml:"token,omitempty"`
1313
}
1414

15-
//nolint: stylecheck // This is unintentionally missing documentation.
15+
//nolint:stylecheck // This is unintentionally missing documentation.
1616
func (n Node) MarshalJSON() ([]byte, error) {
1717
return json.Marshal(map[string]interface{}{
1818
"storage": n.Storage,

internal/praefect/coordinator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ func NewCoordinator(
235235
return coordinator
236236
}
237237

238-
//nolint: stylecheck // This is unintentionally missing documentation.
238+
//nolint:stylecheck // This is unintentionally missing documentation.
239239
func (c *Coordinator) Describe(descs chan<- *prometheus.Desc) {
240240
prometheus.DescribeByCollect(c, descs)
241241
}
242242

243-
//nolint: stylecheck // This is unintentionally missing documentation.
243+
//nolint:stylecheck // This is unintentionally missing documentation.
244244
func (c *Coordinator) Collect(metrics chan<- prometheus.Metric) {
245245
c.votersMetric.Collect(metrics)
246246
c.txReplicationCountMetric.Collect(metrics)

internal/praefect/datastore/assignment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewAssignmentStore(db glsql.Querier, configuredStorages map[string][]string
3737
return AssignmentStore{db: db, configuredStorages: configuredStorages}
3838
}
3939

40-
//nolint: stylecheck // This is unintentionally missing documentation.
40+
//nolint:stylecheck // This is unintentionally missing documentation.
4141
func (s AssignmentStore) GetHostAssignments(ctx context.Context, virtualStorage string, repositoryID int64) ([]string, error) {
4242
configuredStorages, ok := s.configuredStorages[virtualStorage]
4343
if !ok {

0 commit comments

Comments
 (0)