Skip to content

Commit ebb2909

Browse files
committed
chore: groups nosprintfhostport files to a package
1 parent 57b2ccb commit ebb2909

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

pkg/golinters/nosprintfhostport.go renamed to pkg/golinters/nosprintfhostport/nosprintfhostport.go

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

33
import (
44
"github.com/stbenjam/no-sprintf-host-port/pkg/analyzer"
@@ -7,7 +7,7 @@ import (
77
"github.com/golangci/golangci-lint/pkg/goanalysis"
88
)
99

10-
func NewNoSprintfHostPort() *goanalysis.Linter {
10+
func New() *goanalysis.Linter {
1111
a := analyzer.Analyzer
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 nosprintfhostport
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
@@ -76,6 +76,7 @@ import (
7676
"github.com/golangci/golangci-lint/pkg/golinters/noctx"
7777
"github.com/golangci/golangci-lint/pkg/golinters/nolintlint"
7878
"github.com/golangci/golangci-lint/pkg/golinters/nonamedreturns"
79+
"github.com/golangci/golangci-lint/pkg/golinters/nosprintfhostport"
7980
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
8081
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
8182
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
@@ -573,7 +574,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
573574
WithURL("https://github.com/sivchari/nosnakecase").
574575
Deprecated("The repository of the linter has been deprecated by the owner.", "v1.48.1", "revive 'var-naming'"),
575576

576-
linter.NewConfig(golinters.NewNoSprintfHostPort()).
577+
linter.NewConfig(nosprintfhostport.New()).
577578
WithSince("v1.46.0").
578579
WithPresets(linter.PresetStyle).
579580
WithURL("https://github.com/stbenjam/no-sprintf-host-port"),

0 commit comments

Comments
 (0)