Skip to content

Commit 9807e1f

Browse files
committed
chore: groups musttag files to a package
1 parent fa7126e commit 9807e1f

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

pkg/golinters/musttag.go renamed to pkg/golinters/musttag/musttag.go

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

33
import (
44
"go-simpler.org/musttag"
@@ -8,7 +8,7 @@ import (
88
"github.com/golangci/golangci-lint/pkg/goanalysis"
99
)
1010

11-
func NewMustTag(setting *config.MustTagSettings) *goanalysis.Linter {
11+
func New(setting *config.MustTagSettings) *goanalysis.Linter {
1212
var funcs []musttag.Func
1313

1414
if setting != nil {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package musttag
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+
}
File renamed without changes.

test/testdata/musttag_custom.go renamed to pkg/golinters/musttag/testdata/musttag_custom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Emusttag
2-
//golangcitest:config_path testdata/configs/musttag.yml
2+
//golangcitest:config_path testdata/musttag.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
@@ -67,6 +67,7 @@ import (
6767
"github.com/golangci/golangci-lint/pkg/golinters/mirror"
6868
"github.com/golangci/golangci-lint/pkg/golinters/misspell"
6969
"github.com/golangci/golangci-lint/pkg/golinters/mnd"
70+
"github.com/golangci/golangci-lint/pkg/golinters/musttag"
7071
"github.com/golangci/golangci-lint/pkg/golinters/nolintlint"
7172
"github.com/golangci/golangci-lint/pkg/golinters/protogetter"
7273
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
@@ -514,7 +515,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
514515
WithAutoFix().
515516
WithURL("https://github.com/client9/misspell"),
516517

517-
linter.NewConfig(golinters.NewMustTag(&cfg.LintersSettings.MustTag)).
518+
linter.NewConfig(musttag.New(&cfg.LintersSettings.MustTag)).
518519
WithSince("v1.51.0").
519520
WithLoadForGoAnalysis().
520521
WithPresets(linter.PresetStyle, linter.PresetBugs).

0 commit comments

Comments
 (0)