[clang-tidy] Fix lint warning in ClangTidyDiagnosticConsumer.cpp (NFC)
Calling clang-tidy on ClangTidyDiagnosticConsumer.cpp gives a "unmatched NOLINTBEGIN without a subsequent NOLINTEND" warning. The "NOLINTBEGIN" and "NOLINTEND" string literals used in the implementation of `createNolintError()` get mistaken for actual NOLINTBEGIN/END comments used to suppress clang-tidy warnings. Rewrite the string literals so that they can no longer be mistaken for actual suppression comments. Differential Revision: https://reviews.llvm.org/D113472
This commit is contained in:
parent
9b7c584ed8
commit
0076957202
@ -374,13 +374,11 @@ static ClangTidyError createNolintError(const ClangTidyContext &Context,
|
||||
bool IsNolintBegin) {
|
||||
ClangTidyError Error("clang-tidy-nolint", ClangTidyError::Error,
|
||||
Context.getCurrentBuildDirectory(), false);
|
||||
StringRef Message =
|
||||
IsNolintBegin
|
||||
? "unmatched 'NOLINTBEGIN' comment without a subsequent 'NOLINTEND' "
|
||||
"comment"
|
||||
: "unmatched 'NOLINTEND' comment without a previous 'NOLINTBEGIN' "
|
||||
"comment";
|
||||
Error.Message = tooling::DiagnosticMessage(Message, SM, Loc);
|
||||
auto Message = Twine("unmatched 'NOLINT") +
|
||||
(IsNolintBegin ? "BEGIN" : "END") + "' comment without a " +
|
||||
(IsNolintBegin ? "subsequent" : "previous") + " 'NOLINT" +
|
||||
(IsNolintBegin ? "END" : "BEGIN") + "' comment";
|
||||
Error.Message = tooling::DiagnosticMessage(Message.str(), SM, Loc);
|
||||
return Error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user