diff --git a/common/config/.golangci.yml b/common/config/.golangci.yml index b9b6f68bf8..52918655c0 100644 --- a/common/config/.golangci.yml +++ b/common/config/.golangci.yml @@ -15,6 +15,7 @@ linters: - ineffassign - lll - misspell + - modernize - revive - staticcheck - unconvert @@ -94,6 +95,38 @@ linters: locale: US ignore-rules: - cancelled + modernize: + # List of analyzers to disable. + # By default, all analyzers are enabled. + disable: + # Replace interface{} with any. + - any + # Replace []byte(fmt.Sprintf) with fmt.Appendf. + - fmtappendf + # Replace explicit loops over maps with calls to maps package. + - mapsloop + # Simplify code by using go1.26's new(expr). + - newexpr + # Suggest replacing omitempty with omitzero for struct fields. + - omitzero + # Replace reflect.TypeOf(x) with TypeFor[T](). + - reflecttypefor + # Replace loops with slices.Contains or slices.ContainsFunc. + - slicescontains + # Replace sort.Slice with slices.Sort for basic types. + - slicessort + # Use iterators instead of Len/At-style APIs. + - stditerators + # Replace HasPrefix/TrimPrefix with CutPrefix. + - stringscutprefix + # Replace += with strings.Builder. + - 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 revive: confidence: 0 severity: warning