# Taken from https://github.com/nasa/cFS/blob/main/.clang-format
---
Language:        Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands:   true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment  # changed from cFS
BreakBeforeBraces: Custom  # changed to allow extern C blocks
BraceWrapping:
  AfterCaseLabel: true
  AfterControlStatement: true
  AfterEnum: true
  AfterExternBlock: false
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  AfterUnion: true
  BeforeCatch: true
  BeforeElse: true
  BeforeWhile: true
  SplitEmptyFunction: false

BreakBeforeTernaryOperators: true
BreakStringLiterals: true
ColumnLimit:     120
CommentPragmas:  ''
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false # different than cFS
DerivePointerAlignment: false
DisableFormat:   false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: []
IncludeBlocks:   Preserve
IncludeCategories:  []
IncludeIsMainRegex: '$'
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentPPDirectives: None
IndentWidth:     4
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd:   ''
MaxEmptyLinesToKeep: 1
PackConstructorInitializers: Never  # more strict than cFS
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments:  true
SortIncludes:    false # more strict than cFS
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpaceBeforeCpp11BracedList: true
SpacesBeforeTrailingComments: 1
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard:        c++11
TabWidth:        8
UseTab:          Never
...

