[PATCH] D95168: [clang-format] Add InsertBraces option

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 3 03:50:06 PDT 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/BraceInserter.cpp:105
+  FormatToken *getNext(int &Line, FormatToken *current) {
+    if (Line == 0 && current == nullptr) {
+      return Lines[0]->First;
----------------
HazardyKnusperkeks wrote:
> Remove the {
> Oh the irony. :)
I know!, I'm glad you liked that! (sorry!)

To be honest I can't help myself when I work in LLVM, because this is our company's style, but really this is why I'm keen to add "Remove" support because I need something to keep me honest.

I'm not going to feel that bad, I've run this ability to remove {} over parts of the LLVM code already, its "carnage!!!"

We ALL haven't been keeping a consistent style, My only hope is as we cover some of the LLVM specific cases the amount of churn will reduce (but don't hold your breath!!!) 

But I think this is why this is a good idea of @tiagoma , having something like this in clang-format is quite an eye opener. I've already used the Insert ability in our company's legacy code and its great!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95168



More information about the cfe-commits mailing list