# Unified C++/CUDA style for fast_ulysses (a standalone, framework-agnostic custom-op package).
# clang-format finds this file by upward search, keeping csrc/ independent of any outer repo style.
Language: Cpp
Standard: c++17
ColumnLimit: 120

# --- Indentation ---
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
ConstructorInitializerIndentWidth: 4
AccessModifierOffset: -4
NamespaceIndentation: None
IndentCaseLabels: true
IndentPPDirectives: None
IndentWrappedFunctionNames: false

# --- Alignment ---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
DerivePointerAlignment: false
PointerAlignment: Left

# --- Braces & line breaks ---
BreakBeforeBraces: Stroustrup
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
Cpp11BracedListStyle: true
PackConstructorInitializers: CurrentLine

# --- Short-X-on-one-line family ---
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# --- Argument / parameter packing ---
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: false
BinPackParameters: false

# --- Spaces ---
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# --- Empty lines & includes ---
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
SortIncludes: CaseSensitive

# --- Misc ---
CompactNamespaces: false
FixNamespaceComments: true
ReflowComments: true
SortUsingDeclarations: false
