[PATCH] D40671: [clang-tidy] Support specific checks for NOLINT directive

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 06:41:15 PST 2017


aaron.ballman added inline comments.


================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:295
+                          unsigned DiagID, const ClangTidyContext &Context) {
+  const auto NolintIndex = Line.find(NolintMacro);
+  if (NolintIndex != StringRef::npos) {
----------------
Only use `auto` when the type is spelled out explicitly in the initialization (usually through a cast or constructor). Same comment applies elsewhere.


================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:311-313
+          for (auto &Check : Checks) {
+            Check = Check.trim();
+          }
----------------
`llvm::transform(Checks, Checks.begin(), [](StringRef S) { return S.trim(); });`


================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:314
+          }
+          return std::find(Checks.begin(), Checks.end(), CheckName) !=
+                 Checks.end();
----------------
Can use `llvm::find(Checks, CheckName)`


https://reviews.llvm.org/D40671





More information about the cfe-commits mailing list