Skip to content

Commit 8cef16a

Browse files
committed
added comment for return {} branch
1 parent bf7c107 commit 8cef16a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,12 @@ std::vector<Fix>
406406
clangTidyNoLintFixes(const clang::tidy::ClangTidyContext &CTContext,
407407
const clang::Diagnostic &Info, const Diag &Diag) {
408408
auto RuleName = CTContext.getCheckName(Diag.ID);
409-
if (RuleName.empty() || Diag.Severity >= DiagnosticsEngine::Error ||
409+
if (
410+
// If this isn't a clang-tidy diag
411+
RuleName.empty() ||
412+
// NOLINT does not work on Serverity Error or above
413+
Diag.Severity >= DiagnosticsEngine::Error ||
414+
// No point adding extra fixes if the Diag is for a different file
410415
!Diag.InsideMainFile) {
411416
return {};
412417
}

0 commit comments

Comments
 (0)