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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 3 04:26:33 PDT 2021


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/Format.cpp:2844
+
+    if (Style.InsertBraces != FormatStyle::BIS_Never)
+      Passes.emplace_back([&](const Environment &Env) {
----------------
Why is this just C++ (LK_Cpp is also Objective C++ and C and Objective C I think)

Why wouldn't I want to add "{}" in C# and/or JavaScript?


================
Comment at: clang/unittests/Format/FormatTest.cpp:76
+    // clang::format::internal::reformat does not run any of the options that
+    // modify code for ObjC
+    if (Style.Language == FormatStyle::LK_Cpp &&
----------------
Something here doesn't seem correct, I don't really understand the comment?


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