Skip to content

Commit 6a96347

Browse files
committed
chore: groups perfsprint files to a package
1 parent 72fbf17 commit 6a96347

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

pkg/golinters/perfsprint.go renamed to pkg/golinters/perfsprint/perfsprint.go

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

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

11-
func NewPerfSprint(settings *config.PerfSprintSettings) *goanalysis.Linter {
11+
func New(settings *config.PerfSprintSettings) *goanalysis.Linter {
1212
a := analyzer.New()
1313

1414
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 perfsprint
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/perfsprint_custom.go renamed to pkg/golinters/perfsprint/testdata/perfsprint_custom.go

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

55
import (

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import (
7878
"github.com/golangci/golangci-lint/pkg/golinters/nonamedreturns"
7979
"github.com/golangci/golangci-lint/pkg/golinters/nosprintfhostport"
8080
"github.com/golangci/golangci-lint/pkg/golinters/paralleltest"
81+
"github.com/golangci/golangci-lint/pkg/golinters/perfsprint"
8182
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
8283
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
8384
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
@@ -586,7 +587,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
586587
WithPresets(linter.PresetStyle, linter.PresetTest).
587588
WithURL("https://github.com/kunwardeep/paralleltest"),
588589

589-
linter.NewConfig(golinters.NewPerfSprint(&cfg.LintersSettings.PerfSprint)).
590+
linter.NewConfig(perfsprint.New(&cfg.LintersSettings.PerfSprint)).
590591
WithSince("v1.55.0").
591592
WithLoadForGoAnalysis().
592593
WithPresets(linter.PresetPerformance).

0 commit comments

Comments
 (0)