Skip to content

Commit b407bb8

Browse files
authored
revive: add rule name in message. (#1772)
1 parent 42ff682 commit b407bb8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/golinters/revive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
109109
for i := range results {
110110
issues = append(issues, goanalysis.NewIssue(&result.Issue{
111111
Severity: string(results[i].Severity),
112-
Text: fmt.Sprintf("%q", results[i].Failure.Failure),
112+
Text: fmt.Sprintf("%s: %s", results[i].RuleName, results[i].Failure.Failure),
113113
Pos: token.Position{
114114
Filename: results[i].Position.Start.Filename,
115115
Line: results[i].Position.Start.Line,

test/testdata/revive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "time"
77
func testRevive(t *time.Duration) error {
88
if t == nil {
99
return nil
10-
} else { // ERROR "if block ends with a return statement, so drop this else and outdent its block"
10+
} else { // ERROR "indent-error-flow: if block ends with a return statement, .*"
1111
return nil
1212
}
1313
}

0 commit comments

Comments
 (0)