Skip to content

Commit

Permalink
[clangd] Re-enable clang-tidy's nolint blocks
Browse files Browse the repository at this point in the history
The previous inefficient implementation is polished.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D119701
  • Loading branch information
hokein committed Mar 17, 2022
1 parent f66d375 commit eb265e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ParsedAST.cpp
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit eb265e3

Please sign in to comment.