Skip to content

Commit 0d12ab0

Browse files
committed
docs: describe configuration for error-strings rule
1 parent 3bbfedb commit 0d12ab0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

RULES_DESCRIPTIONS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,19 @@ _Configuration_: N/A
456456
## error-strings
457457

458458
_Description_: By convention, for better readability, error messages should not be capitalized or end with punctuation or a newline.
459+
By default, the rule analyzes functions for creating errors from `fmt`, `errors`, and `github.com/pkg/errors`.
460+
Optionally, the rule can be configured to analyze user functions that create errors.
459461

460462
More information [here](https://go.dev/wiki/CodeReviewComments#error-strings)
461463

462-
_Configuration_: N/A
464+
_Configuration_: ([]string) the list of additional error functions to check. The format of values is `package.FunctionName`.
465+
466+
Example:
467+
468+
```toml
469+
[rule.error-strings]
470+
arguments = ["xerrors.Errorf"]
471+
```
463472

464473
## errorf
465474

0 commit comments

Comments
 (0)