Skip to content

Commit 15f1fe1

Browse files
clang-format fixes in ClangTidyDiagnosticConsumer.cpp and DiagnosticsTets.cpp
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77023
1 parent 9c8ec99 commit 15f1fe1

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ ClangTidyError::ClangTidyError(StringRef CheckName,
124124
: tooling::Diagnostic(CheckName, DiagLevel, BuildDirectory),
125125
IsWarningAsError(IsWarningAsError) {}
126126

127-
128127
class ClangTidyContext::CachedGlobList {
129128
public:
130129
CachedGlobList(StringRef Globs) : Globs(Globs) {}
@@ -710,9 +709,9 @@ struct LessClangTidyError {
710709
const tooling::DiagnosticMessage &M1 = LHS.Message;
711710
const tooling::DiagnosticMessage &M2 = RHS.Message;
712711

713-
return
714-
std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName, M1.Message) <
715-
std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);
712+
return std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName,
713+
M1.Message) <
714+
std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);
716715
}
717716
};
718717
struct EqualClangTidyError {

clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ MATCHER_P3(Fix, Range, Replacement, Message,
6161
arg.Edits[0].range == Range && arg.Edits[0].newText == Replacement;
6262
}
6363

64-
MATCHER_P(FixMessage, Message, "") {
65-
return arg.Message == Message;
66-
}
64+
MATCHER_P(FixMessage, Message, "") { return arg.Message == Message; }
6765

6866
MATCHER_P(EqualToLSPDiag, LSPDiag,
6967
"LSP diagnostic " + llvm::to_string(LSPDiag)) {
@@ -258,13 +256,13 @@ TEST(DiagnosticsTest, ClangTidy) {
258256
Diag(Test.range("macroarg"),
259257
"multiple unsequenced modifications to 'y'"),
260258
AllOf(
261-
Diag(Test.range("main"),
262-
"use a trailing return type for this function"),
263-
DiagSource(Diag::ClangTidy),
264-
DiagName("modernize-use-trailing-return-type"),
265-
// Verify that we don't have "[check-name]" suffix in the message.
266-
WithFix(FixMessage("use a trailing return type for this function")))
267-
));
259+
Diag(Test.range("main"),
260+
"use a trailing return type for this function"),
261+
DiagSource(Diag::ClangTidy),
262+
DiagName("modernize-use-trailing-return-type"),
263+
// Verify that we don't have "[check-name]" suffix in the message.
264+
WithFix(FixMessage(
265+
"use a trailing return type for this function")))));
268266
}
269267

270268
TEST(DiagnosticTest, ClangTidySuppressionComment) {
@@ -836,8 +834,9 @@ TEST(IncludeFixerTest, NoCrashOnTemplateInstantiations) {
836834
auto Index = buildIndexWithSymbol({});
837835
TU.ExternalIndex = Index.get();
838836

839-
EXPECT_THAT(TU.build().getDiagnostics(),
840-
ElementsAre(Diag(Test.range(), "use of undeclared identifier 'a'")));
837+
EXPECT_THAT(
838+
TU.build().getDiagnostics(),
839+
ElementsAre(Diag(Test.range(), "use of undeclared identifier 'a'")));
841840
}
842841

843842
TEST(DiagsInHeaders, DiagInsideHeader) {

0 commit comments

Comments
 (0)