Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2149,6 +2149,8 @@ linters:
- slicessort
# Use iterators instead of Len/At-style APIs.
- stditerators
# Replace strings.Index etc. with strings.Cut.
- stringscut
# Replace HasPrefix/TrimPrefix with CutPrefix.
- stringscutprefix
# Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
Expand All @@ -2157,6 +2159,8 @@ linters:
- stringsbuilder
# Replace context.WithCancel with t.Context in tests.
- testingcontext
# Replace unsafe pointer arithmetic with function calls.
- unsafefuncs
# Replace wg.Add(1)/go/wg.Done() with wg.Go.
- waitgroup

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ require (
golang.org/x/mod v0.31.0
golang.org/x/sync v0.19.0
golang.org/x/sys v0.39.0
golang.org/x/tools v0.39.0
golang.org/x/tools v0.40.0
honnef.co/go/tools v0.6.1
mvdan.cc/gofumpt v0.9.2
mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15
Expand Down
8 changes: 4 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,12 @@
"slicescontains",
"slicessort",
"stditerators",
"stringscut",
"stringscutprefix",
"stringsseq",
"stringsbuilder",
"testingcontext",
"unsafefuncs",
"waitgroup"
]
},
Expand Down
20 changes: 2 additions & 18 deletions pkg/golinters/modernize/modernize.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func New(settings *config.ModernizeSettings) *goanalysis.Linter {
var analyzers []*analysis.Analyzer

if settings == nil {
analyzers = cleanSuite()
analyzers = modernize.Suite
} else {
for _, analyzer := range cleanSuite() {
for _, analyzer := range modernize.Suite {
if slices.Contains(settings.Disable, analyzer.Name) {
continue
}
Expand All @@ -32,19 +32,3 @@ func New(settings *config.ModernizeSettings) *goanalysis.Linter {
nil).
WithLoadMode(goanalysis.LoadModeTypesInfo)
}

func cleanSuite() []*analysis.Analyzer {
var analyzers []*analysis.Analyzer

for _, analyzer := range modernize.Suite {
// Disabled because of false positives
// https://github.com/golang/go/issues/76687
if analyzer.Name == "stringscut" {
continue
}

analyzers = append(analyzers, analyzer)
}

return analyzers
}
Loading