Skip to content

Commit dfd5ab6

Browse files
committed
chore: groups stylecheck files to a package
1 parent 672d73d commit dfd5ab6

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

pkg/golinters/stylecheck.go renamed to pkg/golinters/stylecheck/stylecheck.go

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

33
import (
44
"golang.org/x/tools/go/analysis"
@@ -10,7 +10,7 @@ import (
1010
"github.com/golangci/golangci-lint/pkg/golinters/internal"
1111
)
1212

13-
func NewStylecheck(settings *config.StaticCheckSettings) *goanalysis.Linter {
13+
func New(settings *config.StaticCheckSettings) *goanalysis.Linter {
1414
cfg := internal.StaticCheckConfig(settings)
1515

1616
// `scconfig.Analyzer` is a singleton, then it's not possible to have more than one instance for all staticcheck "sub-linters".
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package stylecheck
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
@@ -90,6 +90,7 @@ import (
9090
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
9191
"github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck"
9292
"github.com/golangci/golangci-lint/pkg/golinters/staticcheck"
93+
"github.com/golangci/golangci-lint/pkg/golinters/stylecheck"
9394
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
9495
"github.com/golangci/golangci-lint/pkg/golinters/whitespace"
9596
"github.com/golangci/golangci-lint/pkg/golinters/zerologlint"
@@ -681,7 +682,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
681682
WithURL("https://github.com/opennota/check").
682683
Deprecated("The owner seems to have abandoned the linter.", "v1.49.0", "unused"),
683684

684-
linter.NewConfig(golinters.NewStylecheck(&cfg.LintersSettings.Stylecheck)).
685+
linter.NewConfig(stylecheck.New(&cfg.LintersSettings.Stylecheck)).
685686
WithSince("v1.20.0").
686687
WithLoadForGoAnalysis().
687688
WithPresets(linter.PresetStyle).

0 commit comments

Comments
 (0)