[clang] [clang-format][NFC] Improve KeepFormFeed option decription (PR #176654)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 18 17:55:00 PST 2026


================
@@ -3517,10 +3517,17 @@ struct FormatStyle {
   /// \version 3.7
   // bool KeepEmptyLinesAtTheStartOfBlocks;
 
-  /// Keep the form feed character if it's immediately preceded and followed by
-  /// a newline. Multiple form feeds and newlines within a whitespace range are
-  /// replaced with a single newline and form feed followed by the remaining
-  /// newlines.
+  /// Keep the form feed character (``\f``) if it's immediately preceded and
+  /// followed by a newline. Multiple form feeds and newlines within a
+  /// whitespace range are replaced with a single newline and form feed
+  /// followed by the remaining newlines.
+  /// \code
+  ///   false:          true:
+  ///
+  ///   "int i;\n"      "int i;\n"
+  ///   "\n"            "\f\n"
+  ///   "void f();"     "void f();"
+  /// \endcode
----------------
owenca wrote:

I would undo it and add a link to the GNU style instead. For example:
```suggestion
  /// Keep the form feed character if it's immediately preceded and followed by
  /// a newline. Multiple form feeds and newlines within a whitespace range are
  /// replaced with a single newline and form feed followed by the remaining
  /// newlines. (See
  /// www.gnu.org/prep/standards/html_node/Formatting.html#:~:text=formfeed.)
```

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


More information about the cfe-commits mailing list