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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user