diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-12-14 16:13:57 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-12-14 16:13:57 +0000 |
commit | 3d161ab6f437b2a5eeea4f29f56a611d42a8c8f0 (patch) | |
tree | b4d17ba5154bc50ac31d22a567d717c048cdccf1 /clang-tools-extra/test/clang-tidy/nolintnextline.cpp | |
parent | f902ef0a5d07db499eb3f9dab00cc3ca9362b9fe (diff) | |
download | bcm5719-llvm-3d161ab6f437b2a5eeea4f29f56a611d42a8c8f0.tar.gz bcm5719-llvm-3d161ab6f437b2a5eeea4f29f56a611d42a8c8f0.zip |
Add support for NOLINT and NOLINTNEXTLINE comments mentioning specific check names.
Supports a comma-separated list of check names to be disabled on the given line. Also supports * as a wildcard to disable all lint diagnostic messages on that line.
Patch by Anton (xgsa).
llvm-svn: 320713
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/nolintnextline.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/nolintnextline.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/clang-tools-extra/test/clang-tidy/nolintnextline.cpp b/clang-tools-extra/test/clang-tidy/nolintnextline.cpp index d18f335c2ec..a97928ae0ac 100644 --- a/clang-tools-extra/test/clang-tidy/nolintnextline.cpp +++ b/clang-tools-extra/test/clang-tidy/nolintnextline.cpp @@ -4,8 +4,24 @@ class A { A(int i); }; // NOLINTNEXTLINE class B { B(int i); }; -// NOLINTNEXTLINE(we-dont-care-about-categories-yet) +// NOLINTNEXTLINE(for-some-other-check) class C { C(int i); }; +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: single-argument constructors must be marked explicit + +// NOLINTNEXTLINE(*) +class C1 { C1(int i); }; + +// NOLINTNEXTLINE(not-closed-bracket-is-treated-as-skip-all +class C2 { C2(int i); }; + +// NOLINTNEXTLINE(google-explicit-constructor) +class C3 { C3(int i); }; + +// NOLINTNEXTLINE(some-check, google-explicit-constructor) +class C4 { C4(int i); }; + +// NOLINTNEXTLINE without-brackets-skip-all, another-check +class C5 { C5(int i); }; // NOLINTNEXTLINE @@ -28,6 +44,6 @@ MACRO(G) // NOLINTNEXTLINE MACRO_NOARG -// CHECK-MESSAGES: Suppressed 4 warnings (4 NOLINT) +// CHECK-MESSAGES: Suppressed 8 warnings (8 NOLINT) // RUN: %check_clang_tidy %s google-explicit-constructor %t -- |