lefticus / cpp_weekly

The official C++ Weekly Repository. Code samples and notes of future / past episodes will land here at various times. PR's will be accepted in some cases.
The Unlicense
662 stars 24 forks source link

Making your first clang-tidy check #236

Open lefticus opened 1 year ago

lefticus commented 1 year ago

https://clang.llvm.org/docs/LibASTMatchersReference.html#narrowing-matchers

https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-part-2-examining-the-clang-ast-with-clang-query/

https://clang.llvm.org/extra/clang-tidy/Contributing.html#writing-a-clang-tidy-check

dotnwat commented 1 year ago

I just went through this process and it was pretty cool. I was targeting a cpp core guideline, so I also took the plunge to figure out how to use phabricator and the whole clang code submission / review system (https://reviews.llvm.org/D137514). We put the check into production, but upstream clang pointed out many extra bits that needed to be done to make it generic enough for upstreaming. Good stuff!