For example, I want my array looks like this
std::vector<std::vector<std::vector<int>>> input = {
{
{1, 3, 5, 7},
{10, 11, 16, 20},
{23, 30, 34, 60}
},
{
{1, 3, 5, 7},
{10, 11, 16, 20},
{23, 30, 34, 60}
}
};
But with clang-format, it makes it less readable
std::vector<std::vector<std::vector<int>>> input = {{{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}}, {{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}}};
After checking the clang-format document (verison 20), I'm using 18
AlignArrayOfStructures: Left makes it better but it is still not what I'm trying to achieve.
std::vector<std::vector<std::vector<int>>> input = {
{{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}},
{{1, 3, 5, 7}, {10, 11, 16, 20}, {23, 30, 34, 60}}
};
My current clang-format configuration file,
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
SplitEmptyFunction: false
AfterControlStatement: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
AfterCaseLabel: true
InsertNewlineAtEOF: true
IncludeBlocks: Merge
#Clang11?: IndentCaseBlocks: true
IndentCaseLabels: true
#Clang11: IndentExternBlock: true
IndentPPDirectives: None
IndentWidth: 4
AllowShortFunctionsOnASingleLine: Empty
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 16
PenaltyBreakBeforeFirstCallParameter: 2
PenaltyBreakString: 64
PenaltyExcessCharacter: 0
PenaltyReturnTypeOnItsOwnLine: 0
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
IncludeCategories:
- Regex: '"*PlatformIO.h"'
Priority: -5
- Regex: '"*TextIOTypes.h"'
Priority: -4
- Regex: '<[Ww]indows.h>'
Priority: -3
- Regex: '<*\/.h>'
Priority: -2
- Regex: '"*\/.h"'
Priority: 1
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
UseCRLF: false
UseTab: Never
IndentAccessModifiers: true
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
ColumnLimit: 80
RemoveBracesLLVM: false
RemoveEmptyLinesInUnwrappedLines: true
RemoveSemicolon: true
{{, like is done here: stackoverflow.com/a/70782265/724039