Add settings examples for gocritic (#1562)
This commit is contained in:
parent
92d94ffeea
commit
87cdb2ddf9
@ -149,11 +149,44 @@ linters-settings:
|
|||||||
disabled-tags:
|
disabled-tags:
|
||||||
- experimental
|
- experimental
|
||||||
|
|
||||||
settings: # settings passed to gocritic
|
# Settings passed to gocritic.
|
||||||
|
# The settings key is the name of a supported gocritic checker.
|
||||||
|
# The list of supported checkers can be find in https://go-critic.github.io/overview.
|
||||||
|
settings:
|
||||||
captLocal: # must be valid enabled check name
|
captLocal: # must be valid enabled check name
|
||||||
|
# whether to restrict checker to params only (default true)
|
||||||
paramsOnly: true
|
paramsOnly: true
|
||||||
|
elseif:
|
||||||
|
# whether to skip balanced if-else pairs (default true)
|
||||||
|
skipBalanced: true
|
||||||
|
hugeParam:
|
||||||
|
# size in bytes that makes the warning trigger (default 80)
|
||||||
|
sizeThreshold: 80
|
||||||
|
nestingReduce:
|
||||||
|
# min number of statements inside a branch to trigger a warning (default 5)
|
||||||
|
bodyWidth: 5
|
||||||
|
rangeExprCopy:
|
||||||
|
# size in bytes that makes the warning trigger (default 512)
|
||||||
|
sizeThreshold: 512
|
||||||
|
# whether to check test functions (default true)
|
||||||
|
skipTestFuncs: true
|
||||||
rangeValCopy:
|
rangeValCopy:
|
||||||
|
# size in bytes that makes the warning trigger (default 128)
|
||||||
sizeThreshold: 32
|
sizeThreshold: 32
|
||||||
|
# whether to check test functions (default true)
|
||||||
|
skipTestFuncs: true
|
||||||
|
ruleguard:
|
||||||
|
# path to a gorules file for the ruleguard checker
|
||||||
|
rules: ''
|
||||||
|
truncateCmp:
|
||||||
|
# whether to skip int/uint/uintptr types (default true)
|
||||||
|
skipArchDependent: true
|
||||||
|
underef:
|
||||||
|
# whether to skip (*x).method() calls where x is a pointer receiver (default true)
|
||||||
|
skipRecvDeref: true
|
||||||
|
unnamedResult:
|
||||||
|
# whether to check exported functions
|
||||||
|
checkExported: true
|
||||||
gocyclo:
|
gocyclo:
|
||||||
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
# minimal code complexity to report, 30 by default (but we recommend 10-20)
|
||||||
min-complexity: 10
|
min-complexity: 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user