[PATCH] D93844: [clang-format] Add possibility to be based on parent directory

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 27 04:02:30 PST 2021


HazardyKnusperkeks marked an inline comment as done.
HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/Format.cpp:3067
+  if (!ChildFormatTextToApply.empty()) {
+    assert(ChildFormatTextToApply.size() == 1);
+
----------------
zwliew wrote:
> Is there a reason behind limiting the number of children configs to 1 in this case? When the fallback is not used, more than 1 children configs are allowed (line 3036).
> 
> Sorry for digging this up, I came across this seemingly arbitrary decision when working on some changes to https://reviews.llvm.org/D72326
Yeah but it doesn't happen, there is at most only one `.clang-format` in the parent directory path which is found. So we assert on that and then don't need to loop over what is exactly one element big.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93844



More information about the cfe-commits mailing list