Skip to content

Commit dfafdbe

Browse files
committed
chore: groups rowserrcheck files to a package
1 parent 3e54dd3 commit dfafdbe

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

pkg/golinters/rowserrcheck.go renamed to pkg/golinters/rowserrcheck/rowserrcheck.go

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

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

11-
func NewRowsErrCheck(settings *config.RowsErrCheckSettings) *goanalysis.Linter {
11+
func New(settings *config.RowsErrCheckSettings) *goanalysis.Linter {
1212
var pkgs []string
1313
if settings != nil {
1414
pkgs = settings.Packages
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package rowserrcheck
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+
}

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import (
8585
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
8686
"github.com/golangci/golangci-lint/pkg/golinters/reassign"
8787
"github.com/golangci/golangci-lint/pkg/golinters/revive"
88+
"github.com/golangci/golangci-lint/pkg/golinters/rowserrcheck"
8889
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
8990
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
9091
"github.com/golangci/golangci-lint/pkg/golinters/whitespace"
@@ -632,7 +633,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
632633
ConsiderSlow().
633634
WithURL("https://github.com/mgechev/revive"),
634635

635-
linter.NewConfig(golinters.NewRowsErrCheck(&cfg.LintersSettings.RowsErrCheck)).
636+
linter.NewConfig(rowserrcheck.New(&cfg.LintersSettings.RowsErrCheck)).
636637
WithSince("v1.23.0").
637638
WithLoadForGoAnalysis().
638639
WithPresets(linter.PresetBugs, linter.PresetSQL).

0 commit comments

Comments
 (0)