[PATCH] D141000: [clang-tidy] Introduce HeaderFileExtensions option

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 08:36:38 PST 2023


njames93 added a comment.

You do raise a good point about duplication, Therefore does it make sense to also do the same with the IncludeStyle as lots of checks add new includes.
Though there is a precedent to do away with LLVM/Google style, as clang-format should be responsible for reordering inserted includes.

In D141000#4030877 <https://reviews.llvm.org/D141000#4030877>, @carlosgalvezp wrote:

> I found now what this global `User` option is about:
>
>   /// Specifies the name or e-mail of the user running clang-tidy.
>   ///
>   /// This option is used, for example, to place the correct user name in TODO()
>   /// comments in the relevant check.
>   std::optional<std::string> User;
>
> So it seems to me it's an option used only in one check, and yet it's a global option. Based on that I think it's reasonable to have `HeaderFileExtensions` and `ImplementationFileExtensions` (which are shared among multiple checks) as global as well. It doesn't need to be a CLI option, config-only is fine.

Yeah, I think there is definitely precedent to move that field out of the Options. IMO the google-readability-todo check should instead read that field from the Check GlobalOptions, and its default value should be set in the `GoogleModule::getModuleOptions` virtual function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141000



More information about the cfe-commits mailing list