[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:16:58 PDT 2022


philnik updated this revision to Diff 438185.
philnik added a comment.

Rebased


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128136/new/

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.438185.patch
Type: text/x-patch
Size: 1273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220619/84fe3cae/attachment.bin>


More information about the libcxx-commits mailing list