[PATCH] D95168: Add InsertBraces option

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 23:31:12 PST 2021


curdeius added a comment.

True, I was aware of the presence of some of these options, thank you for indicating others. I'm not yet entirely convinced, especially that clang-tidy behaviour would be possibly different.

Anyway, a few comments just from the first glance.



================
Comment at: clang/docs/ClangFormatStyleOptions.rst:2254
+
+  * ``BIS_WrapLikely`` (in configuration: ``WrapLikely``)
+    Insert braces if wrapping is likely
----------------
Shouldn't it be consistent with clang-tidy? So instead of an enum, this option might take a number of lines that will trigger brace insertion? None may be sth like -1. "Likely" is very vague.


================
Comment at: clang/lib/Format/Format.cpp:1680
+
+      // Get first token that is not a comment
+      const FormatToken *FirstTok = Line->First;
----------------
Nit: put full stop at the end of the comments.


================
Comment at: clang/lib/Format/Format.cpp:1694
+
+      // if the previous line starte a ctrl flow block and this line does not
+      // start with curly
----------------
And make the comments full phrases, starting with a capital letter.


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