[libcxx-commits] [PATCH] D128136: [libc++][clang-format] Change the penalties to prefer a newline over breaking after parens

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 19 02:15:07 PDT 2022


philnik created this revision.
philnik added reviewers: ldionne, Mordante, var-const.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128136

Files:
  libcxx/.clang-format
  libcxx/include/string


Index: libcxx/include/string
===================================================================
--- libcxx/include/string
+++ libcxx/include/string
@@ -539,10 +539,12 @@
 #include <__utility/swap.h>
 #include <__utility/unreachable.h>
 #include <climits>
+#include <compare>
 #include <cstdint>
 #include <cstdio>  // EOF
 #include <cstdlib>
 #include <cstring>
+#include <initializer_list>
 #include <iosfwd>
 #include <limits>
 #include <memory>
@@ -555,19 +557,6 @@
 #  include <cwchar>
 #endif
 
-// standard-mandated includes
-
-// [iterator.range]
-#include <__iterator/access.h>
-#include <__iterator/data.h>
-#include <__iterator/empty.h>
-#include <__iterator/reverse_access.h>
-#include <__iterator/size.h>
-
-// [string.syn]
-#include <compare>
-#include <initializer_list>
-
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
Index: libcxx/.clang-format
===================================================================
--- libcxx/.clang-format
+++ libcxx/.clang-format
@@ -68,7 +68,9 @@
 NamespaceIndentation: Inner
 PackConstructorInitializers: NextLine
 
-PenaltyIndentedWhitespace: 61
+PenaltyIndentedWhitespace: 1
+PenaltyBreakOpenParenthesis: 60
+PenaltyReturnTypeOnItsOwnLine: 10
 
 Language: Cpp
 Standard: c++20


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128136.438184.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220619/067ec520/attachment.bin>


More information about the libcxx-commits mailing list