Skip to content

Commit f7cf21d

Browse files
committed
Add BasedOnStyle key to ClangFormat configuration
The ClangFormat configuration file was previously generated using ClangFormat 11.0.1. The output produced by that version did not contain a `BasedOnStyle` key, which is why it was not present in the configuration despite being supported by 11.0.1. Since Arduino's configuration sets all configuration keys, the `BasedOnStyle` key has no effect anyway. The configuration file generated using ClangFormat 14.0.0 does contain a `BasedOnStyle` key. Unfortunately, regardless of what was set in the configuration, the tool always outputs a key set to an empty string. Even though it is likely not an issue, this is concerning because it is not documented as a supported value.
1 parent b35f9d9 commit f7cf21d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ AlwaysBreakBeforeMultilineStrings: false
2626
AlwaysBreakTemplateDeclarations: No
2727
AttributeMacros:
2828
- __capability
29+
BasedOnStyle: ''
2930
BinPackArguments: true
3031
BinPackParameters: true
3132
BitFieldColonSpacing: Both

other/clang-format-configuration/notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ It is not clear from the documentation, but this truly is an "allow" setting, ra
1414

1515
This key is irrelevant because we define all configuration keys.
1616

17-
**ClangFormat** uses the `LLVM` style as a base by default.
17+
Even though it is not one of the documented possible values, `clang-format --dump-config` outputs `BasedOnStyle: ''`, so we use that.
1818

1919
## `BraceWrapping`
2020

0 commit comments

Comments
 (0)