[PATCH] D117129: [clang-tidy] Extract Class IncluderClangTidyCheck

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 15 15:26:07 PST 2022


njames93 added a comment.

In D117129#3239514 <https://reviews.llvm.org/D117129#3239514>, @LegalizeAdulthood wrote:

> In D117129#3239143 <https://reviews.llvm.org/D117129#3239143>, @njames93 wrote:
>
>> My proposed idea was putting the `IncludeInserter` instance
>> inside the `ClangTidyContext`, but then only registering it if
>> any checks actually want to use it.
>
> Use of the `IncludeInserter` would be signaled by an argument
> to the ctor fo r`ClangTidyCheck` in the c'tor for the derived
> class?

There is a hurdle to overcome with this, Currently each check can have its own include style - which doesn't really make sense. Hopefully people actually just use the global version of the option instead.
However if we were to coalesce all checks to use the same `IncludeInserter`, we would have to force clang-tidy to just read the global version.
Going this route it'd be best if we warned on configs that specify their own IncludeStyle. I've created a draft implementation above, definitely needs work though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117129



More information about the cfe-commits mailing list