Skip to content

Commit 92b2038

Browse files
committed
fix: adjust sorting of include directives
1 parent d108364 commit 92b2038

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.clang-format

+12-10
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ TabWidth: 4
6767
IndentWidth: 4
6868

6969
#/
70-
# Always use tab characters to fill whitespace.
70+
# Always use tab characters for indentation.
7171
#/
72-
UseTab: Always
72+
UseTab: ForIndentation
7373

7474
#/
7575
# Always use `\n` for line endings.
@@ -254,21 +254,20 @@ AlignEscapedNewlines: DontAlign # NOTE: disabled due to very large column limit
254254
AlignOperands: DontAlign
255255

256256
#/
257-
# Align trailing comments on consecutive lines.
257+
# Leave trailing comments as they are.
258258
#
259259
# @example
260-
# // Good...
260+
# // Okay...
261261
# int a; // Comment
262262
# int ab; // Comment
263263
#
264264
# @example
265-
# // Bad...
265+
# // Okay...
266266
# int a; // Comment
267267
# int ab; // Comment
268268
#/
269269
AlignTrailingComments:
270-
Kind: Always
271-
OverEmptyLines: 0
270+
Kind: Leave
272271

273272
#/
274273
# Disallow putting arguments onto the next line.
@@ -819,22 +818,25 @@ EmptyLineBeforeAccessModifier: Always
819818
FixNamespaceComments: true
820819

821820
#/
822-
# Always merge multiple `#include` blocks together and sort as one.
821+
# Always preserve `#include` blocks and sort separately.
823822
#
824823
# @example
825824
# // Good...
826-
# #include "a.h"
827825
# #include "b.h"
826+
#
827+
# #include "a.h"
828+
# #include "c.h"
828829
# #include "<stdint.h>"
829830
#
830831
# @example
831832
# // Bad...
832833
# #include "b.h"
833834
#
834835
# #include "<stdint.h>"
836+
# #include "c.h"
835837
# #include "a.h"
836838
#/
837-
IncludeBlocks: Merge
839+
IncludeBlocks: Preserve
838840

839841
#/
840842
# Define `#include` categories and assign ordering priorities.

0 commit comments

Comments
 (0)