Skip to content

Commit e522ae5

Browse files
authored
Merge pull request #4927 from mercedes-benz/enable_gci_formater
🌱: introduce gci as formatter in golangci-lint
2 parents 82d7ca4 + 728a3b0 commit e522ae5

File tree

36 files changed

+60
-48
lines changed

36 files changed

+60
-48
lines changed

.golangci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,23 @@ linters:
8383
path: hack/docs/*
8484
- linters:
8585
- revive
86-
text: 'should have comment or be unexported'
86+
text: "should have comment or be unexported"
8787
paths:
8888
- third_party$
8989
- builtin$
9090
- examples$
9191
formatters:
9292
enable:
93+
- gci
9394
- gofmt
9495
- gofumpt
9596
- goimports
97+
settings:
98+
gci:
99+
sections:
100+
- standard
101+
- default
102+
- prefix(sigs.k8s.io/kubebuilder)
96103
exclusions:
97104
generated: lax
98105
paths:

cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cmd
1919
import (
2020
"github.com/sirupsen/logrus"
2121
"github.com/spf13/afero"
22+
2223
"sigs.k8s.io/kubebuilder/v4/pkg/cli"
2324
cfgv3 "sigs.k8s.io/kubebuilder/v4/pkg/config/v3"
2425
"sigs.k8s.io/kubebuilder/v4/pkg/machinery"

hack/docs/generate_samples.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
log "github.com/sirupsen/logrus"
21+
2122
cronjob "sigs.k8s.io/kubebuilder/v4/hack/docs/internal/cronjob-tutorial"
2223
gettingstarted "sigs.k8s.io/kubebuilder/v4/hack/docs/internal/getting-started"
2324
multiversion "sigs.k8s.io/kubebuilder/v4/hack/docs/internal/multiversion-tutorial"

hack/docs/internal/cronjob-tutorial/generate_cronjob.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
log "github.com/sirupsen/logrus"
2525
"github.com/spf13/afero"
26+
2627
hackutils "sigs.k8s.io/kubebuilder/v4/hack/docs/utils"
2728
pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
2829
"sigs.k8s.io/kubebuilder/v4/pkg/plugins/golang/v4/scaffolds"

hack/docs/internal/getting-started/generate_getting_started.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ import (
2020
"os/exec"
2121
"path/filepath"
2222

23-
pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
23+
log "github.com/sirupsen/logrus"
2424

2525
hackutils "sigs.k8s.io/kubebuilder/v4/hack/docs/utils"
26-
27-
log "github.com/sirupsen/logrus"
26+
pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
2827
"sigs.k8s.io/kubebuilder/v4/test/e2e/utils"
2928
)
3029

hack/docs/internal/multiversion-tutorial/generate_multiversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"path/filepath"
2222

2323
log "github.com/sirupsen/logrus"
24+
2425
hackutils "sigs.k8s.io/kubebuilder/v4/hack/docs/utils"
2526
pluginutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
2627
"sigs.k8s.io/kubebuilder/v4/test/e2e/utils"

hack/docs/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"os"
2121

2222
log "github.com/sirupsen/logrus"
23+
2324
"sigs.k8s.io/kubebuilder/v4/test/e2e/utils"
2425
)
2526

pkg/cli/alpha.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"strings"
2222

2323
"github.com/spf13/cobra"
24+
2425
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha"
2526
)
2627

pkg/cli/alpha/command.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package alpha
1616
import (
1717
log "github.com/sirupsen/logrus"
1818
"github.com/spf13/cobra"
19+
1920
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha/internal"
2021
)
2122

pkg/cli/alpha/internal/generate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ import (
2323
"os/exec"
2424
"strings"
2525

26-
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha/internal/common"
27-
2826
log "github.com/sirupsen/logrus"
2927

28+
"sigs.k8s.io/kubebuilder/v4/pkg/cli/alpha/internal/common"
3029
"sigs.k8s.io/kubebuilder/v4/pkg/config"
3130
"sigs.k8s.io/kubebuilder/v4/pkg/config/store"
3231
"sigs.k8s.io/kubebuilder/v4/pkg/model/resource"

0 commit comments

Comments
 (0)