[clang] [llvm] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

Owen Pan via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 01:15:00 PDT 2025


================
@@ -1180,16 +1183,47 @@ TEST_F(FormatTestJS, InliningFunctionLiterals) {
                "}",
                Style);
 
-  Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
+  Style.AllowShortFunctionsOnASingleLine =
+      FormatStyle::ShortFunctionStyle::setEmptyOnly();
   verifyFormat("var func = function() {\n"
                "  return 1;\n"
                "};",
                Style);
 }
 
+TEST_F(FormatTestJS, InliningFunctionLiteralsNew) {
----------------
owenca wrote:

Can you also move this test for `Other` to a future patch?

https://github.com/llvm/llvm-project/pull/134337


More information about the llvm-commits mailing list