Skip to content

Commit 1946df2

Browse files
committed
Add BreakBeforeConceptDeclarations key to ClangFormat configuration
The previous ClangFormat configuration was developed for use with ClangFormat 11.0.1. The version of ClangFormat now in use by Arduino tools is 14.0.0. This configuration key was added in the interim. The key value set here was chosen in order to: - Align with behavior of the Arduino IDE 1.x "Auto Format" feature. The `false` value is the most permissive, allowing the user to break or not break at their whim. Since the concepts feature was added to C++ relatively recently, there is not any established style in official Arduino code.
1 parent 7bc1bab commit 1946df2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

other/clang-format-configuration/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ BraceWrapping:
5151
BreakAfterJavaFieldAnnotations: false
5252
BreakBeforeBinaryOperators: NonAssignment
5353
BreakBeforeBraces: Attach
54+
BreakBeforeConceptDeclarations: false
5455
BreakBeforeInheritanceComma: false
5556
BreakBeforeTernaryOperators: true
5657
BreakConstructorInitializers: BeforeColon

other/clang-format-configuration/notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ This key is irrelevant because we define all configuration keys.
2020

2121
This key is ignored when `BreakBeforeBraces` is set to anything other than `Custom`.
2222

23+
## `BreakBeforeConceptDeclarations`
24+
25+
`true` forces the break.
26+
27+
`false` allows the user to break or not break at their whim, in alignment with the Arduino IDE 1.x formatter behavior and Arduino's `AlwaysBreakTemplateDeclarations: No` configuration.
28+
2329
## `BreakBeforeInheritanceComma`
2430

2531
Seems to be a backwards compatibility name for `BreakInheritanceList: BeforeComma`:

0 commit comments

Comments
 (0)