[libcxx-commits] [PATCH] D144755: [libc++] Improves clang-format settings.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 24 12:41:42 PST 2023


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

Add a new test based .clang-format file which inherits from the generic
one. This moves some test specific formatting rules to the test
directory.

The main benefit is that headers are sorted, which makes it more likely
to catch these errors before creating a review instead of spotting the
error in the CI clang-tidy step.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144755

Files:
  libcxx/.clang-format
  libcxx/test/.clang-format


Index: libcxx/test/.clang-format
===================================================================
--- /dev/null
+++ libcxx/test/.clang-format
@@ -0,0 +1,5 @@
+BasedOnStyle: InheritParentConfig
+
+# Disable formatting options which may break tests.
+SortIncludes: false
+ReflowComments: false
Index: libcxx/.clang-format
===================================================================
--- libcxx/.clang-format
+++ libcxx/.clang-format
@@ -77,10 +77,6 @@
 PointerAlignment: Left
 
 
-# Disable formatting options which may break tests.
-SortIncludes: false
-ReflowComments: false
-
 # libc++'s preferred indentions of preprocessor statements.
 IndentPPDirectives: AfterHash
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144755.500276.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230224/5b58c95d/attachment.bin>


More information about the libcxx-commits mailing list