Skip to content

Commit 5025dcc

Browse files
committed
chore: groups predeclared files to a package
1 parent 4430a42 commit 5025dcc

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

pkg/golinters/predeclared.go renamed to pkg/golinters/predeclared/predeclared.go

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

33
import (
44
"github.com/nishanths/predeclared/passes/predeclared"
@@ -8,7 +8,7 @@ import (
88
"github.com/golangci/golangci-lint/pkg/goanalysis"
99
)
1010

11-
func NewPredeclared(settings *config.PredeclaredSettings) *goanalysis.Linter {
11+
func New(settings *config.PredeclaredSettings) *goanalysis.Linter {
1212
a := predeclared.Analyzer
1313

1414
var cfg 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 predeclared
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/predeclared_custom.go renamed to pkg/golinters/predeclared/testdata/predeclared_custom.go

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

55
func hello() {

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ import (
8080
"github.com/golangci/golangci-lint/pkg/golinters/paralleltest"
8181
"github.com/golangci/golangci-lint/pkg/golinters/perfsprint"
8282
"github.com/golangci/golangci-lint/pkg/golinters/prealloc"
83+
"github.com/golangci/golangci-lint/pkg/golinters/predeclared"
8384
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
8485
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
8586
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
@@ -599,7 +600,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
599600
WithPresets(linter.PresetPerformance).
600601
WithURL("https://github.com/alexkohler/prealloc"),
601602

602-
linter.NewConfig(golinters.NewPredeclared(&cfg.LintersSettings.Predeclared)).
603+
linter.NewConfig(predeclared.New(&cfg.LintersSettings.Predeclared)).
603604
WithSince("v1.35.0").
604605
WithPresets(linter.PresetStyle).
605606
WithURL("https://github.com/nishanths/predeclared"),

0 commit comments

Comments
 (0)