Skip to content

Commit 1cc6814

Browse files
Remove funlen
1 parent c6f1114 commit 1cc6814

File tree

24 files changed

+11
-34
lines changed

24 files changed

+11
-34
lines changed

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ linters:
4646
- bodyclose
4747
- dogsled
4848
- errcheck
49-
- funlen
5049
- gocognit
5150
- goconst
5251
- gocritic
@@ -98,7 +97,6 @@ issues:
9897
- path: ".*_test.go"
9998
linters:
10099
- bodyclose
101-
- funlen
102100
- gocognit
103101
- goconst
104102
- path: ".*_test.go"

commands/helpers/archive/tarzstd/tarzstd_archiver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewArchiver(w io.Writer, dir string, level archive.CompressionLevel) (archi
4242

4343
// Archive archives all files.
4444
//
45-
//nolint:funlen,gocognit
45+
//nolint:gocognit
4646
func (a *archiver) Archive(ctx context.Context, files map[string]os.FileInfo) error {
4747
sorted := make([]string, 0, len(files))
4848
for filename := range files {

commands/helpers/archive/tarzstd/tarzstd_extractor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewExtractor(r io.ReaderAt, size int64, dir string) (archive.Extractor, err
2929
// Extract extracts files from the reader to the directory passed to
3030
// NewZipExtractor.
3131
//
32-
//nolint:funlen,gocognit
32+
//nolint:gocognit
3333
func (e *extractor) Extract(ctx context.Context) error {
3434
zr, err := zstd.NewReader(io.NewSectionReader(e.r, 0, e.size), zstd.WithDecoderLowmem(true))
3535
if err != nil {

commands/helpers/cache_extractor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func getRemoteCacheSize(resp *http.Response) int64 {
5454
return int64(length)
5555
}
5656

57-
//nolint:funlen
5857
func (c *CacheExtractorCommand) download(_ int) error {
5958
err := os.MkdirAll(filepath.Dir(c.File), 0o700)
6059
if err != nil {

commands/register.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ func (s *RegisterCommand) doLegacyRegisterRunner() {
335335
s.registered = true
336336
}
337337

338-
//nolint:funlen
339338
func (s *RegisterCommand) askExecutorOptions() {
340339
kubernetes := s.Kubernetes
341340
machine := s.Machine

common/build.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ func (b *Build) StartBuild(
317317
return nil
318318
}
319319

320-
//nolint:funlen
321320
func (b *Build) executeStage(ctx context.Context, buildStage BuildStage, executor Executor) error {
322321
if ctx.Err() != nil {
323322
return ctx.Err()
@@ -448,7 +447,7 @@ func (b *Build) executeArchiveCache(ctx context.Context, state error, executor E
448447
return b.executeStage(ctx, BuildStageArchiveOnFailureCache, executor)
449448
}
450449

451-
//nolint:funlen,gocognit
450+
//nolint:gocognit
452451
func (b *Build) executeScript(ctx context.Context, trace JobTrace, executor Executor) error {
453452
// track job start and create referees
454453
startTime := time.Now()
@@ -702,7 +701,6 @@ func (b *Build) runtimeStateAndError(err error) (BuildRuntimeState, error) {
702701
}
703702
}
704703

705-
//nolint:funlen
706704
func (b *Build) run(ctx context.Context, trace JobTrace, executor Executor) (err error) {
707705
b.setCurrentState(BuildRunRuntimeRunning)
708706

@@ -958,7 +956,6 @@ func (b *Build) CurrentExecutorStage() ExecutorStage {
958956
return b.executorStageResolver()
959957
}
960958

961-
//nolint:funlen
962959
func (b *Build) Run(globalConfig *Config, trace JobTrace) (err error) {
963960
b.setCurrentState(BuildRunStatePending)
964961

common/build_settings.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ func validateVariables(variables JobVariables, b *Build, defaultGitStategy GitSt
143143
}
144144
}
145145

146-
//nolint:funlen
147146
func validate[T any](variables JobVariables, name string, value *T, def T) error {
148147
raw := variables.Value(name)
149148
var err error

common/buildlogger/internal/masker/masker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type masker struct {
5151
next io.WriteCloser
5252
}
5353

54-
//nolint:funlen,gocognit
54+
//nolint:gocognit
5555
func (m *masker) Write(p []byte) (n int, err error) {
5656
if len(p) == 0 {
5757
return 0, nil

common/buildlogger/internal/tokensanitizer/token_masker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type tokenSanitizer struct {
9090
next io.WriteCloser
9191
}
9292

93-
//nolint:funlen,gocognit
93+
//nolint:gocognit
9494
func (m *tokenSanitizer) Write(p []byte) (n int, err error) {
9595
if len(p) == 0 {
9696
return 0, nil

common/buildlogger/internal/urlsanitizer/urlsanitizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func New(w io.WriteCloser) *URLSanitizer {
4949
return &URLSanitizer{w: w, match: make([]byte, 0, max)}
5050
}
5151

52-
//nolint:funlen,gocognit
52+
//nolint:gocognit
5353
func (s *URLSanitizer) Write(p []byte) (n int, err error) {
5454
var last int
5555

common/buildtest/abort.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (c *withContext) WithContext(ctx context.Context) (context.Context, context
2424
return context.WithCancel(ctx)
2525
}
2626

27-
//nolint:funlen,gocognit
27+
//nolint:gocognit
2828
func RunBuildWithCancel(t *testing.T, config *common.RunnerConfig, setup BuildSetupFn) {
2929
abortIncludeStages := []common.BuildStage{
3030
common.BuildStagePrepare,

common/buildtest/job_output_limit.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ var jobOutputLimitExceededTestCases = map[string]jobOutputLimitExceededTestCase{
8080
},
8181
}
8282

83-
// nolint:funlen
8483
func runBuildWithJobOutputLimitExceeded(
8584
t *testing.T,
8685
config *common.RunnerConfig,

common/buildtest/masking.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"gitlab.com/gitlab-org/gitlab-runner/helpers/trace"
1212
)
1313

14-
//nolint:funlen
1514
func RunBuildWithMasking(t *testing.T, config *common.RunnerConfig, setup BuildSetupFn) {
1615
resp, err := common.GetRemoteSuccessfulBuildPrintVars(
1716
config.Shell,

common/buildtest/variables.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func RunBuildWithExpandedFileVariable(t *testing.T, config *common.RunnerConfig,
5454
}
5555
}
5656

57-
//nolint:funlen
5857
func RunBuildWithPassingEnvsMultistep(t *testing.T, config *common.RunnerConfig, setup BuildSetupFn) {
5958
envVarFn := func(name string) string {
6059
switch config.Shell {

executors/docker/docker.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ func (e *executor) isInPrivilegedServiceList(serviceDefinition common.Image) boo
378378
return isInAllowedPrivilegedImages(serviceDefinition.Name, e.Config.Docker.AllowedPrivilegedServices)
379379
}
380380

381-
//nolint:funlen
382381
func (e *executor) createService(
383382
serviceIndex int,
384383
service, version, image string,
@@ -586,7 +585,6 @@ func (e *executor) isInPrivilegedImageList(imageDefinition common.Image) bool {
586585
return isInAllowedPrivilegedImages(imageDefinition.Name, e.Config.Docker.AllowedPrivilegedImages)
587586
}
588587

589-
//nolint:funlen
590588
func (e *executor) createContainer(
591589
containerType string,
592590
imageDefinition common.Image,
@@ -908,7 +906,7 @@ func (e *executor) overwriteEntrypoint(image *common.Image) []string {
908906
return nil
909907
}
910908

911-
//nolint:funlen,nestif
909+
//nolint:nestif
912910
func (e *executor) connectDocker(options common.ExecutorPrepareOptions) error {
913911
var opts []client.Opt
914912

@@ -1244,7 +1242,6 @@ func (e *executor) prepareBuildsDir(options common.ExecutorPrepareOptions) error
12441242
return nil
12451243
}
12461244

1247-
//nolint:funlen
12481245
func (e *executor) Cleanup() {
12491246
if e.Config.Docker == nil {
12501247
// if there's no Docker config, we got here because Prepare() failed

executors/docker/internal/exec/exec.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ type defaultDocker struct {
6464
logger logrus.FieldLogger
6565
}
6666

67-
//nolint:funlen
6867
func (d *defaultDocker) Exec(ctx context.Context, containerID string, streams IOStreams, gracefulExitFunc wait.GracefulExitFunc) error {
6968
d.logger.Debugln("Attaching to container", containerID, "...")
7069

executors/docker/machine/provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ func (m *machineProvider) Create() common.Executor {
624624
}
625625
}
626626

627-
//nolint:funlen
628627
func newMachineProvider() *machineProvider {
629628
name := "docker+machine"
630629
provider := common.GetExecutorProvider("docker")

executors/internal/autoscaler/acquisition.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func newAcquisitionRef(key string, mapJobImageToVMImage bool) *acquisitionRef {
5454
}
5555
}
5656

57-
//nolint:funlen
5857
func (ref *acquisitionRef) Prepare(
5958
ctx context.Context,
6059
logger buildlogger.Logger,

executors/internal/autoscaler/provider.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ func (p *provider) Shutdown(ctx context.Context) {
110110
wg.Wait()
111111
}
112112

113-
//nolint:funlen
114113
func (p *provider) init(config *common.RunnerConfig) (taskscaler.Taskscaler, bool, error) {
115114
if config.Autoscaler == nil {
116115
return nil, false, fmt.Errorf("executor requires autoscaler config")
@@ -340,7 +339,7 @@ func (p *provider) Collect(ch chan<- prometheus.Metric) {
340339
}
341340
}
342341

343-
//nolint:gocognit,funlen
342+
//nolint:gocognit
344343
func instanceReadyUp(ctx context.Context, config *common.RunnerConfig) taskscaler.UpFunc {
345344
return func(id string, info fleetingprovider.ConnectInfo, cause fleeting.Cause) (keys []string, used int, err error) {
346345
useExternalAddr := true

executors/kubernetes/kubernetes.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ type serviceCreateResponse struct {
288288
err error
289289
}
290290

291-
// nolint:funlen
292291
func (s *executor) Prepare(options common.ExecutorPrepareOptions) (err error) {
293292
s.AbstractExecutor.PrepareConfiguration(options)
294293

executors/kubernetes/overwrites.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ type overwrites struct {
131131
explicitServiceRequests map[string]api.ResourceList
132132
}
133133

134-
//nolint:funlen
135134
func createOverwrites(
136135
config *common.KubernetesConfig,
137136
variables common.JobVariables,

helpers/ssh/stub_ssh_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func (s *StubSSHServer) Stop() error {
204204
}
205205
}
206206

207-
//nolint:gocognit,funlen
207+
//nolint:gocognit
208208
func (s *StubSSHServer) mainLoop(listener net.Listener) {
209209
defer close(s.stopped)
210210

@@ -361,7 +361,7 @@ func copier(to io.Writer, from io.Reader, desc string) (err error) {
361361
return nil
362362
}
363363

364-
//nolint:gocognit,funlen
364+
//nolint:gocognit
365365
func (s *StubSSHServer) handleSession(ctx context.Context, channel ssh.NewChannel) error {
366366
conn, reqs, err := channel.Accept()
367367
if err != nil {

network/gitlab.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ func addTLSData(response *common.JobResponse, tlsData ResponseTLSData) {
582582
}
583583
}
584584

585-
//nolint:funlen
586585
func (n *GitLabClient) RequestJob(
587586
ctx context.Context,
588587
config common.RunnerConfig,

shells/abstract.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ func (b *AbstractShell) handleGetSourcesStrategy(w ShellWriter, build *common.Bu
487487
return nil
488488
}
489489

490-
//nolint:funlen
491490
func (b *AbstractShell) writeRefspecFetchCmd(w ShellWriter, build *common.Build, projectDir string) {
492491
depth := build.GitInfo.Depth
493492

@@ -616,7 +615,6 @@ func (b *AbstractShell) writeSubmoduleUpdateCmds(w ShellWriter, info common.Shel
616615
return nil
617616
}
618617

619-
//nolint:funlen
620618
func (b *AbstractShell) writeSubmoduleUpdateCmd(w ShellWriter, build *common.Build, recursive bool) error {
621619
depth := build.GetSubmoduleDepth()
622620

0 commit comments

Comments
 (0)