Skip to content

Commit 60e54d8

Browse files
committed
chore: groups godox files to a package
1 parent 7f51c8a commit 60e54d8

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

pkg/golinters/godox.go renamed to pkg/golinters/godox/godox.go

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

33
import (
44
"go/token"
@@ -14,14 +14,14 @@ import (
1414
"github.com/golangci/golangci-lint/pkg/result"
1515
)
1616

17-
const godoxName = "godox"
17+
const name = "godox"
1818

19-
func NewGodox(settings *config.GodoxSettings) *goanalysis.Linter {
19+
func New(settings *config.GodoxSettings) *goanalysis.Linter {
2020
var mu sync.Mutex
2121
var resIssues []goanalysis.Issue
2222

2323
analyzer := &analysis.Analyzer{
24-
Name: godoxName,
24+
Name: name,
2525
Doc: goanalysis.TheOnlyanalyzerDoc,
2626
Run: func(pass *analysis.Pass) (any, error) {
2727
issues := runGodox(pass, settings)
@@ -39,7 +39,7 @@ func NewGodox(settings *config.GodoxSettings) *goanalysis.Linter {
3939
}
4040

4141
return goanalysis.NewLinter(
42-
godoxName,
42+
name,
4343
"Tool for detection of FIXME, TODO and other comment keywords",
4444
[]*analysis.Analyzer{analyzer},
4545
nil,
@@ -67,7 +67,7 @@ func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) []goanalysis.
6767
Line: i.Pos.Line,
6868
},
6969
Text: strings.TrimRight(i.Message, "\n"),
70-
FromLinter: godoxName,
70+
FromLinter: name,
7171
}, pass)
7272
}
7373

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package godox
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+
}

test/testdata/godox.go renamed to pkg/golinters/godox/testdata/godox.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egodox
2-
//golangcitest:config_path testdata/configs/godox.yml
2+
//golangcitest:config_path testdata/godox.yml
33
package testdata
44

55
func todoLeftInCode() {

pkg/lint/lintersdb/builder_linter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import (
4141
"github.com/golangci/golangci-lint/pkg/golinters/gocritic"
4242
"github.com/golangci/golangci-lint/pkg/golinters/gocyclo"
4343
"github.com/golangci/golangci-lint/pkg/golinters/godot"
44+
"github.com/golangci/golangci-lint/pkg/golinters/godox"
4445
"github.com/golangci/golangci-lint/pkg/golinters/gofmt"
4546
"github.com/golangci/golangci-lint/pkg/golinters/gofumpt"
4647
"github.com/golangci/golangci-lint/pkg/golinters/goheader"
@@ -306,7 +307,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
306307
WithAutoFix().
307308
WithURL("https://github.com/tetafro/godot"),
308309

309-
linter.NewConfig(golinters.NewGodox(&cfg.LintersSettings.Godox)).
310+
linter.NewConfig(godox.New(&cfg.LintersSettings.Godox)).
310311
WithSince("v1.19.0").
311312
WithPresets(linter.PresetStyle, linter.PresetComment).
312313
WithURL("https://github.com/matoous/godox"),

0 commit comments

Comments
 (0)