Everybody says his or her particular format is optimized for clarity or legibility, a therefore meaningless disambiguation.
The broad goals:
- Reduce visual noise adjacent to words to avoid aggravating astigmatism.
- Consecutive lines of the same form should align as if records in a table.
- Support the Spirit of C’s declaration-mimic-usage idiom:
- Types read right to left.
- Pointers and qualifiers to the east.
This mostly tries to mimic common HPC idioms:
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: Always
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: false
BitFieldColonSpacing: Both
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterStruct: false
AfterUnion: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
BreakAfterAttributes: Always
BreakBeforeBinaryOperators: None
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: false
BreakStringLiterals: true
ColumnLimit: 80
IndentWidth: 2
DerivePointerAlignment: false
IncludeBlocks: Merge
IndentCaseBlocks: true
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PointerAlignment: Right
QualifierAlignment: Custom
QualifierOrder: [ 'static', 'inline', 'constexpr', 'type', 'const', 'volatile', 'restrict' ]
ReflowComments: false # Let author
RemoveParentheses: Leave # Hairy with macros
RemoveSemicolon: true
SortIncludes: CaseInsensitive
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: false
BeforeNonEmptyParentheses: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInParens: Custom
SpacesInParensOptions:
InConditionalStatements: true
Other: true
SpacesInSquareBrackets: true
UseTab: Never