1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00

docs: describe configuration for error-strings rule (#1245)

This commit is contained in:
Oleksandr Redko
2025-02-21 18:29:40 +02:00
committed by GitHub
parent 3bbfedbf43
commit 8cd85e4e6c

View File

@@ -456,10 +456,20 @@ _Configuration_: N/A
## error-strings
_Description_: By convention, for better readability, error messages should not be capitalized or end with punctuation or a newline.
By default, the rule analyzes functions for creating errors from `fmt`, `errors`, and `github.com/pkg/errors`.
Optionally, the rule can be configured to analyze user functions that create errors.
More information [here](https://go.dev/wiki/CodeReviewComments#error-strings)
_Configuration_: N/A
_Configuration_: ([]string) the list of additional error functions to check.
The format of values is `package.FunctionName`.
Example:
```toml
[rule.error-strings]
arguments = ["xerrors.Errorf"]
```
## errorf