Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 17eb3fc

Browse files
Add all configs, structs and entries that the linter needs
1 parent 0d3f690 commit 17eb3fc

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

‎.golangci.reference.yml‎

Lines changed: 1 addition & 0 deletions
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‎

Lines changed: 1 addition & 0 deletions
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‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/golinters/responsewriterlint.go‎

Lines changed: 19 additions & 0 deletions
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‎

Lines changed: 6 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /