Skip to content

Commit 672d73d

Browse files
committed
chore: groups staticcheck files to a package
1 parent dc74f24 commit 672d73d

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

pkg/golinters/staticcheck.go renamed to pkg/golinters/staticcheck/staticcheck.go

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

33
import (
44
"honnef.co/go/tools/staticcheck"
@@ -8,7 +8,7 @@ import (
88
"github.com/golangci/golangci-lint/pkg/golinters/internal"
99
)
1010

11-
func NewStaticcheck(settings *config.StaticCheckSettings) *goanalysis.Linter {
11+
func New(settings *config.StaticCheckSettings) *goanalysis.Linter {
1212
cfg := internal.StaticCheckConfig(settings)
1313
analyzers := internal.SetupStaticCheckAnalyzers(staticcheck.Analyzers, internal.GetGoVersion(settings), cfg.Checks)
1414

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package staticcheck
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
@@ -89,6 +89,7 @@ import (
8989
"github.com/golangci/golangci-lint/pkg/golinters/sloglint"
9090
"github.com/golangci/golangci-lint/pkg/golinters/spancheck"
9191
"github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck"
92+
"github.com/golangci/golangci-lint/pkg/golinters/staticcheck"
9293
"github.com/golangci/golangci-lint/pkg/golinters/tagalign"
9394
"github.com/golangci/golangci-lint/pkg/golinters/whitespace"
9495
"github.com/golangci/golangci-lint/pkg/golinters/zerologlint"
@@ -665,7 +666,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
665666
WithPresets(linter.PresetBugs).
666667
WithURL("https://github.com/jjti/go-spancheck"),
667668

668-
linter.NewConfig(golinters.NewStaticcheck(&cfg.LintersSettings.Staticcheck)).
669+
linter.NewConfig(staticcheck.New(&cfg.LintersSettings.Staticcheck)).
669670
WithEnabledByDefault().
670671
WithSince("v1.0.0").
671672
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)