Skip to content

Commit

Permalink
docs: describe enabled and disabled by default analyzers of govet (#4146
Browse files Browse the repository at this point in the history
)

Co-authored-by: Fernandez Ludovic <[email protected]>
  • Loading branch information
Antonboom and ldez authored Oct 19, 2023
1 parent 904cec8 commit 1bfcc5f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,21 +1044,29 @@ linters-settings:
strict: true
unusedresult:
# Comma-separated list of functions whose results must be used
# (in addition to defaults context.WithCancel,context.WithDeadline,context.WithTimeout,context.WithValue,
# errors.New,fmt.Errorf,fmt.Sprint,fmt.Sprintf,sort.Reverse)
# Default []
# (in addition to default:
# context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf,
# fmt.Sprint, fmt.Sprintf, sort.Reverse
# ).
# Default: []
funcs:
- pkg.MyFunc
# Comma-separated list of names of methods of type func() string whose results must be used
# (in addition to default Error,String)
# Default []
# Default: []
stringmethods:
- MyMethod

# Disable all analyzers.
# Default: false
disable-all: true
# Enable analyzers by name (in addition to default).
# Enable analyzers by name.
# (in addition to default:
# appends, asmdecl, assign, atomic, bools, buildtag, cgocall, composites, copylocks, defers, directive, errorsas,
# framepointer, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, printf, shift, sigchanyzer, slog,
# stdmethods, stringintconv, structtag, testinggoroutine, tests, timeformat, unmarshal, unreachable, unsafeptr,
# unusedresult
# ).
# Run `go tool vet help` to see all analyzers.
# Default: []
enable:
Expand Down Expand Up @@ -1107,6 +1115,10 @@ linters-settings:
# Default: false
enable-all: true
# Disable analyzers by name.
# (in addition to default
# atomicalign, deepequalerrors, fieldalignment, findcall, nilness, reflectvaluecompare, shadow, sortslice,
# timeformat, unusedwrite
# ).
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
Expand Down Expand Up @@ -1275,6 +1287,7 @@ linters-settings:
- k8s.io/klog/v2.InfoS # package level exported functions
- (github.com/go-logr/logr.Logger).Error # "Methods"
- (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver

maintidx:
# Show functions with maintainability index lower than N.
# A high index indicates better maintainability (it's kind of the opposite of complexity).
Expand Down

0 comments on commit 1bfcc5f

Please sign in to comment.