[PATCH] D119701: [clangd] Re-enable clang-tidy's nolint blocks
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 14 02:27:37 PST 2022
hokein created this revision.
hokein added a reviewer: kadircet.
Herald added subscribers: usaxena95, arphaman.
hokein requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.
The previous inefficient implementation is polished.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119701
Files:
clang-tools-extra/clangd/ParsedAST.cpp
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
Index: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -477,9 +477,8 @@
#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.
Index: clang-tools-extra/clangd/ParsedAST.cpp
===================================================================
--- clang-tools-extra/clangd/ParsedAST.cpp
+++ clang-tools-extra/clangd/ParsedAST.cpp
@@ -473,7 +473,7 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119701.408361.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220214/2d92a60c/attachment.bin>
More information about the cfe-commits
mailing list