Skip to content

Commit 7567a5d

Browse files
committed
chore: groups grouper files to a package
1 parent b3d900d commit 7567a5d

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

pkg/golinters/grouper.go renamed to pkg/golinters/grouper/grouper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package grouper
22

33
import (
44
grouper "github.com/leonklingele/grouper/pkg/analyzer"
@@ -8,7 +8,7 @@ import (
88
"github.com/golangci/golangci-lint/pkg/goanalysis"
99
)
1010

11-
func NewGrouper(settings *config.GrouperSettings) *goanalysis.Linter {
11+
func New(settings *config.GrouperSettings) *goanalysis.Linter {
1212
a := grouper.New()
1313

1414
linterCfg := map[string]map[string]any{}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package grouper
2+
3+
import (
4+
"testing"
5+
6+
"github.com/golangci/golangci-lint/test/testshared/integration"
7+
)
8+
9+
func TestFromTestdata(t *testing.T) {
10+
integration.RunTestdata(t)
11+
}

test/testdata/grouper.go renamed to pkg/golinters/grouper/testdata/grouper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egrouper
2-
//golangcitest:config_path testdata/configs/grouper.yml
2+
//golangcitest:config_path testdata/grouper.yml
33
package testdata
44

55
import "fmt" // want "should only use grouped 'import' declarations"

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import (
5353
"github.com/golangci/golangci-lint/pkg/golinters/gosimple"
5454
"github.com/golangci/golangci-lint/pkg/golinters/gosmopolitan"
5555
"github.com/golangci/golangci-lint/pkg/golinters/govet"
56+
"github.com/golangci/golangci-lint/pkg/golinters/grouper"
5657
"github.com/golangci/golangci-lint/pkg/golinters/loggercheck"
5758
"github.com/golangci/golangci-lint/pkg/golinters/mirror"
5859
"github.com/golangci/golangci-lint/pkg/golinters/misspell"
@@ -411,7 +412,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
411412
WithAlternativeNames("vet", "vetshadow").
412413
WithURL("https://pkg.go.dev/cmd/vet"),
413414

414-
linter.NewConfig(golinters.NewGrouper(&cfg.LintersSettings.Grouper)).
415+
linter.NewConfig(grouper.New(&cfg.LintersSettings.Grouper)).
415416
WithSince("v1.44.0").
416417
WithPresets(linter.PresetStyle).
417418
WithURL("https://github.com/leonklingele/grouper"),

0 commit comments

Comments
 (0)