[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option SourceNamingStyle.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 05:20:59 PDT 2020


ymandel added a comment.

In D79380#2019570 <https://reviews.llvm.org/D79380#2019570>, @gribozavr2 wrote:

> LGTM, but I don't understand why this option is called "SourceNamingStyle". Existing ClangTidy checkers call it "IncludeStyle".


Thanks for the review!

Good question. I'd planned to call it "IncludeStyle" only to discover that it is misnamed. We could keep the name for consistency if it's in widespread use, but given that (IMO) it is quite misleading, I'd prefer to avoid it.  At least to me, the name (and its description "A string specifying which include-style is used, llvm or google. Default is llvm.") implies that it controls how the includes are formatted. How they are grouped and ordered, for example.  Yet, they don't. The IncludeSorter groups and orders the headers in exactly the same way no matter the style specification. It's only effect is to determine how a given file is related to header files, specifically how to determine that a header "corresponds" to a the file being examined -- that is, it is _this_ file's header rather than some arbitrary header. So, I figured that "SourceNamingStyle" captures this difference.

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79380





More information about the cfe-commits mailing list