[PATCH] D138505: [clangd] Don't run slow clang-tidy checks by default

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 13:08:02 PST 2022


kadircet added a comment.

thanks LG, i'd like to hear how we're planning to let downstream users customise the list of fast checks. otherwise they have to run with `Loose` at all times.
the easiest i can think of is, generating their own `fastchecks.inc` fragment and #include that in addition to clangd's default list. Any other ideas on this one?



================
Comment at: clang-tools-extra/clangd/ConfigCompile.cpp:488
+             llvm::formatv(
+                 "Speed of clang-tidy check '{0}' is not known. "
+                 "It will only run if ClangTidy.FastCheckFilter is Loose or None",
----------------
nit: s/Speed/Latency (or Performance?)


================
Comment at: clang-tools-extra/clangd/TidyProvider.cpp:312
+  };
+  auto It = Fast.find(Check);
+  if (It == Fast.end())
----------------
nit: some c++17 magic if you want:
```
if (auto It = Fast.find(Check); It != Fast.end())
  return It->second;
return llvm::None;
```


================
Comment at: clang-tools-extra/clangd/tool/Check.cpp:88
+llvm::cl::opt<bool> CheckWarnings{
+    "check-warnings",
+    llvm::cl::desc("Print warnings as well as errors"),
----------------
i think `print-warnings` is probably better than `check` we're not really checking anything.


================
Comment at: clang-tools-extra/clangd/tool/Check.cpp:92
 
 // Print (and count) the error-level diagnostics (warnings are ignored).
 unsigned showErrors(llvm::ArrayRef<Diag> Diags) {
----------------
update the comment (or maybe even drop it?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138505/new/

https://reviews.llvm.org/D138505



More information about the cfe-commits mailing list