You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace IDE 2.x configuration file content with link to source
Arduino IDE 2.x allows the user to customize the output of the "Auto Format" feature via a configuration file.
This system is documented in the "Customizing the Auto Formatter Feature" tutorial.
When the user customizes the formatter, their configuration file is used exclusively by the formatter tool rather than
being merged into the standard configuration. Since the user is likely only interested in modifying a small number of
specific aspect of the standard configuration (e.g., wishing to use "broken" rather than "attached" braces), they will
find it convenient to use Arduino's standard configuration as a base for their custom configuration. For this reason,
the standard configuration is offered in the tutorial.
Previously, the full YAML code of the standard configuration was included in the tutorial page itself. This was the best
approach at the time the tutorial was created because what was the canonical source in the Arduino IDE code base is in a
format not usable in this application.
Since that time, the ClangFormat native YAML file has been published in a dedicated permanent location where it is
hosted as the canonical source for all projects that use the configuration. This enabled the removal of the
configuration code from the tutorial, replaced by a link to the source file.
This change provides the following benefits:
### Reduce maintenance burden
The configuration code must be updated periodically in parallel to bumps of the version of ClangFormat used by Arduino
IDE 2.x and other Arduino development tools.
This is handled as a matter of course in the canonical source file, but the copy hosted in the tutorial content would
have needed updates as well (or else become outdated).
Pointing the reader to the source ensures they will always have the current configuration without any need to maintain
the documentation content.
### Improves approachability of tutorial
The configuration code added a large block of complex YAML to the tutorial. Although it will be necessary for the reader
to eventually work with this code, they don't have any need to browse through it while reading the tutorial. So having
the code as part of the tutorial content didn't add anything of value and also harmed the readability.
Copy file name to clipboardExpand all lines: content/software/ide-v2/tutorials/ide-v2-customize-auto-formatter/content.md
+1-146
Original file line number
Diff line number
Diff line change
@@ -65,152 +65,7 @@ Here you can find the default formatting file used in the Arduino IDE 2.0. If yo
65
65
66
66
***Please note that the custom configuration file completely overrides the Arduino default configuration, rather than merging with it. Any configuration option you don't set in your custom file will be set to the ClangFormat default value.***
67
67
68
-
```cpp
69
-
---
70
-
Language: Cpp
71
-
# LLVM is the default style setting, used when a configuration option is not set here
72
-
BasedOnStyle: LLVM
73
-
AccessModifierOffset: -2
74
-
AlignAfterOpenBracket: Align
75
-
AlignConsecutiveAssignments: false
76
-
AlignConsecutiveBitFields: false
77
-
AlignConsecutiveDeclarations: false
78
-
AlignConsecutiveMacros: false
79
-
AlignEscapedNewlines: DontAlign
80
-
AlignOperands: Align
81
-
AlignTrailingComments: true
82
-
AllowAllArgumentsOnNextLine: true
83
-
AllowAllConstructorInitializersOnNextLine: true
84
-
AllowAllParametersOfDeclarationOnNextLine: true
85
-
AllowShortBlocksOnASingleLine: Always
86
-
AllowShortCaseLabelsOnASingleLine: true
87
-
AllowShortEnumsOnASingleLine: true
88
-
AllowShortFunctionsOnASingleLine: Empty
89
-
AllowShortIfStatementsOnASingleLine: Always
90
-
AllowShortLambdasOnASingleLine: Empty
91
-
AllowShortLoopsOnASingleLine: true
92
-
AlwaysBreakAfterDefinitionReturnType: None
93
-
AlwaysBreakAfterReturnType: None
94
-
AlwaysBreakBeforeMultilineStrings: false
95
-
AlwaysBreakTemplateDeclarations: No
96
-
BinPackArguments: true
97
-
BinPackParameters: true
98
-
# Only used when "BreakBeforeBraces" set to "Custom"
0 commit comments