---
# clang-format configuration for RASPsim
BasedOnStyle: LLVM

# Basic formatting
IndentWidth: 2
TabWidth: 2
UseTab: Never
ColumnLimit: 120

# Language
Language: Cpp
Standard: c++20

# Braces
BreakBeforeBraces: Attach
BraceWrapping:
  AfterClass: false
  AfterControlStatement: Never
  AfterEnum: false
  AfterFunction: false
  AfterNamespace: false
  AfterStruct: false
  AfterUnion: false
  BeforeCatch: false
  BeforeElse: false

# Indentation
NamespaceIndentation: None
IndentCaseLabels: false
IndentPPDirectives: None
AccessModifierOffset: -2

# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignOperands: Align
AlignTrailingComments: true
PointerAlignment: Left

# Spacing
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# Line breaks
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon

# Includes
SortIncludes: false
IncludeBlocks: Preserve

# Other
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
ReflowComments: false