[clang-tools-extra] eb265e3 - [clangd] Re-enable clang-tidy's nolint blocks
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 17 05:54:36 PDT 2022
Author: Haojian Wu
Date: 2022-03-17T13:48:55+01:00
New Revision: eb265e3ba28dbac6d6c18674ae603428753559e9
URL: https://github.com/llvm/llvm-project/commit/eb265e3ba28dbac6d6c18674ae603428753559e9
DIFF: https://github.com/llvm/llvm-project/commit/eb265e3ba28dbac6d6c18674ae603428753559e9.diff
LOG: [clangd] Re-enable clang-tidy's nolint blocks
The previous inefficient implementation is polished.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D119701
Added:
Modified:
clang-tools-extra/clangd/ParsedAST.cpp
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/ParsedAST.cpp b/clang-tools-extra/clangd/ParsedAST.cpp
index c2239722737a3..295418c8434ab 100644
--- a/clang-tools-extra/clangd/ParsedAST.cpp
+++ b/clang-tools-extra/clangd/ParsedAST.cpp
@@ -467,7 +467,7 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
if (IsInsideMainFile && CTContext->shouldSuppressDiagnostic(
DiagLevel, Info, TidySuppressedErrors,
/*AllowIO=*/false,
- /*EnableNolintBlocks=*/false)) {
+ /*EnableNolintBlocks=*/true)) {
// FIXME: should we expose the suppression error (invalid use of
// NOLINT comments)?
return DiagnosticsEngine::Ignored;
diff --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
index 7fd7babe68a75..a1b66b43a87b8 100644
--- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -477,9 +477,8 @@ TEST(DiagnosticTest, ClangTidySuppressionComment) {
#define BAD2 BAD
double h = BAD2; // NOLINT
// NOLINTBEGIN
- // FIXME: re-enable when NOLINTBEGIN suppresss block is enabled in clangd.
- // double x = BAD2;
- // double y = BAD2;
+ double x = BAD2;
+ double y = BAD2;
// NOLINTEND
// verify no crashes on unmatched nolints.
More information about the cfe-commits
mailing list