Skip to content

Commit 932b1f4

Browse files
authoredFeb 21, 2025··
docs: add arguments to revive.error-strings (#5455)
1 parent 6194858 commit 932b1f4

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed
 

‎.golangci.next.reference.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2580,6 +2580,8 @@ linters-settings:
25802580
severity: warning
25812581
disabled: false
25822582
exclude: [""]
2583+
arguments:
2584+
- "xerrors.New"
25832585
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#errorf
25842586
- name: errorf
25852587
severity: warning

‎pkg/golinters/revive/testdata/revive.go

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package testdata
55
import (
66
"net/http"
77
"time"
8+
9+
"golang.org/x/xerrors"
810
)
911

1012
func SampleRevive(t *time.Duration) error {
@@ -28,3 +30,7 @@ func testReviveComplexity(s string) { // want "cyclomatic: function testReviveCo
2830
return
2931
}
3032
}
33+
34+
func testErrorStrings() {
35+
_ = xerrors.New("Some error!") // want "error strings should not be capitalized or end with punctuation or a newline"
36+
}

‎pkg/golinters/revive/testdata/revive.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ linters-settings:
1717
arguments: [ 10 ]
1818
- name: max-public-structs
1919
arguments: [ 3 ]
20+
- name: error-strings
21+
arguments:
22+
- "xerrors.New"

0 commit comments

Comments
 (0)
Please sign in to comment.