Skip to content

Commit dc74f24

Browse files
committed
chore: groups sqlclosecheck files to a package
1 parent 161986b commit dc74f24

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

pkg/golinters/sqlclosecheck.go renamed to pkg/golinters/sqlclosecheck/sqlclosecheck.go

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

33
import (
44
"github.com/ryanrolds/sqlclosecheck/pkg/analyzer"
@@ -7,7 +7,7 @@ import (
77
"github.com/golangci/golangci-lint/pkg/goanalysis"
88
)
99

10-
func NewSQLCloseCheck() *goanalysis.Linter {
10+
func New() *goanalysis.Linter {
1111
a := analyzer.NewAnalyzer()
1212

1313
return goanalysis.NewLinter(
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package sqlclosecheck
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
@@ -88,6 +88,7 @@ import (
8888
"github.com/golangci/golangci-lint/pkg/golinters/rowserrcheck"
8989
"github.com/golangci/golangci-lint/pkg/golinters/sloglint"
9090
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
91+
"github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck"
9192
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
9293
"github.com/golangci/golangci-lint/pkg/golinters/whitespace"
9394
"github.com/golangci/golangci-lint/pkg/golinters/zerologlint"
@@ -652,7 +653,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
652653
WithURL("https://github.com/kyoh86/scopelint").
653654
Deprecated("The repository of the linter has been deprecated by the owner.", "v1.39.0", "exportloopref"),
654655

655-
linter.NewConfig(golinters.NewSQLCloseCheck()).
656+
linter.NewConfig(sqlclosecheck.New()).
656657
WithSince("v1.28.0").
657658
WithPresets(linter.PresetBugs, linter.PresetSQL).
658659
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)