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

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


================
@@ -623,20 +623,29 @@ TEST(ConfigParseTest, ParsesConfiguration) {
   CHECK_PARSE("AllowShortBlocksOnASingleLine: true",
               AllowShortBlocksOnASingleLine, FormatStyle::SBS_Always);
 
-  Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
   CHECK_PARSE("AllowShortFunctionsOnASingleLine: None",
-              AllowShortFunctionsOnASingleLine, FormatStyle::SFS_None);
+              AllowShortFunctionsOnASingleLine,
+              FormatStyle::ShortFunctionStyle({}));
   CHECK_PARSE("AllowShortFunctionsOnASingleLine: Inline",
----------------
owenca wrote:

Please add `CHECK_PARSE_NESTED_BOOL` tests for `Empty`, `Inline`, and `Other` before `BraceWrapping` in `TEST(ConfigParseTest, ParsesConfigurationBools)`.

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


More information about the cfe-commits mailing list