diff --git a/pkg/golinters/nolintlint/nolintlint.go b/pkg/golinters/nolintlint/nolintlint.go index 410db5ab94e9..b746e6f3b2bc 100644 --- a/pkg/golinters/nolintlint/nolintlint.go +++ b/pkg/golinters/nolintlint/nolintlint.go @@ -64,8 +64,8 @@ type NoExplanation struct { //nolint:gocritic // TODO(ldez) must be change in the future. func (i NoExplanation) Details() string { - return fmt.Sprintf("directive `%s` should provide explanation such as `%s // this is why`", - i.fullDirective, i.fullDirectiveWithoutExplanation) + return fmt.Sprintf("directive `%s` is missing an explanation; it should follow the format `//nolint[:] // `", + i.fullDirective) } func (i NoExplanation) String() string { return toString(i) } diff --git a/pkg/golinters/nolintlint/nolintlint_test.go b/pkg/golinters/nolintlint/nolintlint_test.go index 895127204a80..2daee30c81b6 100644 --- a/pkg/golinters/nolintlint/nolintlint_test.go +++ b/pkg/golinters/nolintlint/nolintlint_test.go @@ -39,10 +39,10 @@ func foo() { other() //nolintother }`, expected: []issueWithReplacement{ - {issue: "directive `//nolint` should provide explanation such as `//nolint // this is why` at testing.go:5:1"}, - {issue: "directive `//nolint` should provide explanation such as `//nolint // this is why` at testing.go:7:9"}, - {issue: "directive `//nolint //` should provide explanation such as `//nolint // this is why` at testing.go:8:9"}, - {issue: "directive `//nolint // ` should provide explanation such as `//nolint // this is why` at testing.go:9:9"}, + {issue: "directive `//nolint` is missing an explanation; it should follow the format `//nolint[:] // ` at testing.go:5:1"}, + {issue: "directive `//nolint` is missing an explanation; it should follow the format `//nolint[:] // ` at testing.go:7:9"}, + {issue: "directive `//nolint //` is missing an explanation; it should follow the format `//nolint[:] // ` at testing.go:8:9"}, + {issue: "directive `//nolint // ` is missing an explanation; it should follow the format `//nolint[:] // ` at testing.go:9:9"}, }, }, { @@ -56,7 +56,7 @@ package bar //nolint:dupl func foo() {}`, expected: []issueWithReplacement{ - {issue: "directive `//nolint:dupl` should provide explanation such as `//nolint:dupl // this is why` at testing.go:6:1"}, + {issue: "directive `//nolint:dupl` is missing an explanation; it should follow the format `//nolint[:] // ` at testing.go:6:1"}, }, }, {