JonasToth added a comment.
I like the new framework!
================
Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:43
+ if (Rule.Explanation) {
+ if (Expected<std::string> Explanation = Rule.Explanation(Result)) {
+ Message = *Explanation;
----------------
these if-else are single statement, so the braces can be ellided.
================
Comment at: clang-tools-extra/unittests/clang-tidy/TransformerTidyTest.cpp:38
+ IfInverterTidy(StringRef Name, ClangTidyContext *Context)
+ : TransformerTidy(invertIf(), Name, Context) {}
+};
----------------
If we allow to pass in a callable, that returns a `RewriteRule`we would have a
more flexible framework in clang-tidy.
Going with this for now is ok in my opinion as the only good usecase that comes
to my mind would be statistics.
But If some transformation needs to remember what has been done before only a
`RewriteRule` as state is not sufficient and stateful actions would require
global state (MEH!).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61386/new/
https://reviews.llvm.org/D61386
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits