Skip to content

Commit

Permalink
revive: add rule name in message. (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Feb 24, 2021
1 parent 42ff682 commit b407bb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/golinters/revive.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func NewRevive(cfg *config.ReviveSettings) *goanalysis.Linter {
for i := range results {
issues = append(issues, goanalysis.NewIssue(&result.Issue{
Severity: string(results[i].Severity),
Text: fmt.Sprintf("%q", results[i].Failure.Failure),
Text: fmt.Sprintf("%s: %s", results[i].RuleName, results[i].Failure.Failure),
Pos: token.Position{
Filename: results[i].Position.Start.Filename,
Line: results[i].Position.Start.Line,
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/revive.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "time"
func testRevive(t *time.Duration) error {
if t == nil {
return nil
} else { // ERROR "if block ends with a return statement, so drop this else and outdent its block"
} else { // ERROR "indent-error-flow: if block ends with a return statement, .*"
return nil
}
}

0 comments on commit b407bb8

Please sign in to comment.