Skip to content

Commit 42bbe40

Browse files
authored
docs(gocritic): add enable and disable ruleguard settings (#2885)
* docs: ruleguard: add missing `enable` and `disable` settings * Don't use go-critic groups and tags
1 parent a23fc2c commit 42bbe40

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.golangci.reference.yml

+11
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ linters-settings:
474474
# ruleguard prints the specific Where() condition that was rejected.
475475
#
476476
# The flag is passed to the ruleguard 'debug-group' argument.
477+
# Default: ""
477478
debug: 'emptyDecl'
478479
# Deprecated, use 'failOn' param.
479480
# If set to true, identical to failOn='all', otherwise failOn=''
@@ -484,12 +485,22 @@ linters-settings:
484485
# - 'all': fail on all errors.
485486
# - 'import': ruleguard rule imports a package that cannot be found.
486487
# - 'dsl': gorule file does not comply with the ruleguard DSL.
488+
# Default: ""
487489
failOn: dsl
488490
# Comma-separated list of file paths containing ruleguard rules.
489491
# If a path is relative, it is relative to the directory where the golangci-lint command is executed.
490492
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
491493
# Glob patterns such as 'rules-*.go' may be specified.
494+
# Default: ""
492495
rules: '${configDir}/ruleguard/rules-*.go,${configDir}/myrule1.go'
496+
# Comma-separated list of enabled groups or skip empty to enable everything.
497+
# Tags can be defined with # character prefix.
498+
# Default: "<all>"
499+
enable: "myGroupName,#myTagName"
500+
# Comma-separated list of disabled groups or skip empty to enable everything.
501+
# Tags can be defined with # character prefix.
502+
# Default: ""
503+
disable: "myGroupName,#myTagName"
493504
tooManyResultsChecker:
494505
# Maximum number of results.
495506
# Default: 5

0 commit comments

Comments
 (0)