Skip to content

Commit 56919e3

Browse files
committed
Add all configs, structs and entries that the linter needs
1 parent 0cc445b commit 56919e3

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

.golangci.reference.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2072,6 +2072,7 @@ linters:
20722072
- predeclared
20732073
- promlinter
20742074
- reassign
2075+
- responsewriterlint
20752076
- revive
20762077
- rowserrcheck
20772078
- scopelint

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ require (
4848
github.com/hashicorp/go-multierror v1.1.1
4949
github.com/hashicorp/go-version v1.6.0
5050
github.com/hexops/gotextdiff v1.0.3
51+
github.com/javorszky/go-responsewriter-lint v0.1.2
5152
github.com/jgautheron/goconst v1.5.1
5253
github.com/jingyugao/rowserrcheck v1.1.1
5354
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af

go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/responsewriterlint.go

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package golinters
2+
3+
import (
4+
"github.com/golangci/golangci-lint/pkg/config"
5+
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
6+
"github.com/javorszky/go-responsewriter-lint/pkg/analyzer"
7+
"golang.org/x/tools/go/analysis"
8+
)
9+
10+
func NewResponseWriterLint(_ *config.ReassignSettings) *goanalysis.Linter {
11+
a := analyzer.New()
12+
13+
return goanalysis.NewLinter(
14+
a.Name,
15+
a.Doc,
16+
[]*analysis.Analyzer{a},
17+
nil,
18+
).WithLoadMode(goanalysis.LoadModeTypesInfo)
19+
}

pkg/lint/lintersdb/manager.go

+6
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,12 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
722722
WithLoadForGoAnalysis().
723723
WithURL("https://github.com/curioswitch/go-reassign"),
724724

725+
linter.NewConfig(golinters.NewResponseWriterLint(nil)).
726+
WithSince("1.52.0").
727+
WithPresets(linter.PresetBugs).
728+
ConsiderSlow().
729+
WithURL("https://github.com/javorszky/go-responsewriter-lint"),
730+
725731
linter.NewConfig(golinters.NewRevive(reviveCfg)).
726732
WithSince("v1.37.0").
727733
WithPresets(linter.PresetStyle, linter.PresetMetaLinter).

0 commit comments

Comments
 (0)