[PATCH] D59932: [clang-tidy] **Prototype**: Add fix description to clang-tidy checks.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 06:19:10 PDT 2019


hokein marked an inline comment as done.
hokein added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/ClangTidyCheck.h:109
+  ///     not supported.
+  virtual llvm::StringRef fixDescription() { return ""; }
+
----------------
alexfh wrote:
> Checks can provide different fixes with different semantics depending on the context. It seems incorrect to assume that there can be one reasonable description for all of them.
Yes, as mentioned in the comment, this is the limitation of this approach -- I assume we don't have a large number of these checks, most checks are providing a  single fix.

Another alternative is to use some heuristic mechanisms to do a translation from the `Replacement`, like we do in clangd, https://github.com/llvm-mirror/clang-tools-extra/blob/master/clangd/Diagnostics.cpp#L350.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59932





More information about the cfe-commits mailing list