Skip to content

Commit 63e0b7f

Browse files
committed
chore: groups nakedret files to a package
1 parent 9807e1f commit 63e0b7f

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

pkg/golinters/nakedret.go renamed to pkg/golinters/nakedret/nakedret.go

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

33
import (
44
"github.com/alexkohler/nakedret/v2"
@@ -8,7 +8,7 @@ import (
88
"github.com/golangci/golangci-lint/pkg/goanalysis"
99
)
1010

11-
func NewNakedret(settings *config.NakedretSettings) *goanalysis.Linter {
11+
func New(settings *config.NakedretSettings) *goanalysis.Linter {
1212
var maxLines int
1313
if settings != nil {
1414
maxLines = settings.MaxFuncLines
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package nakedret
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
@@ -68,6 +68,7 @@ import (
6868
"github.com/golangci/golangci-lint/pkg/golinters/misspell"
6969
"github.com/golangci/golangci-lint/pkg/golinters/mnd"
7070
"github.com/golangci/golangci-lint/pkg/golinters/musttag"
71+
"github.com/golangci/golangci-lint/pkg/golinters/nakedret"
7172
"github.com/golangci/golangci-lint/pkg/golinters/nolintlint"
7273
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
7374
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
@@ -521,7 +522,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
521522
WithPresets(linter.PresetStyle, linter.PresetBugs).
522523
WithURL("https://github.com/go-simpler/musttag"),
523524

524-
linter.NewConfig(golinters.NewNakedret(&cfg.LintersSettings.Nakedret)).
525+
linter.NewConfig(nakedret.New(&cfg.LintersSettings.Nakedret)).
525526
WithSince("v1.19.0").
526527
WithPresets(linter.PresetStyle).
527528
WithURL("https://github.com/alexkohler/nakedret"),

0 commit comments

Comments
 (0)