[PATCH] D96744: clang-format IncludeBlocks: Regroup determination of "main" for framework-style includes fix

Mitchell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 2 12:51:47 PST 2021


mitchell-stellar added a comment.

I am in favor of a new option, `IncludeIsMainAllowBraces`. It keeps things simple and does not cause any backwards-compatibility issues. The `${}` variables are clever, but if "users unconcerned with formatting ... could get the current functionality by including a simple rule [that includes a variable]", I think it might be asking too much. Being able to write (and read) an include regex without referring to documentation seems ideal to me. You mentioned automatically adding variables in rules for backwards-compatibility, but I'd be a bit concerned about robustness and too much magic going on behind the scenes for users to understand if something goes wrong or has unexpected/unexplained results.

Admittedly I don't fully comprehend the proposed additions and all their ins-and-outs, but I do understand a new, simple option.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96744



More information about the cfe-commits mailing list