Skip to content

Commit

Permalink
style(cxx-cuda): update clang-format settings for CUDA and C++ templates
Browse files Browse the repository at this point in the history
- Add BinPackArguments and BinPackParameters settings
- Set PackConstructorInitializers to Never
- Improve code formatting consistency across projects
  • Loading branch information
pplmx committed Dec 19, 2024
1 parent 9db6d5c commit 37d3264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions template/cuda/{{cookiecutter.project_slug}}/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ UseTab: Never # Exclusively use spaces for indentat
AllowShortIfStatementsOnASingleLine: Never # Prevent single-line if statements
AllowShortFunctionsOnASingleLine: Inline # Allow short functions on single line
AllowShortLoopsOnASingleLine: false # Prevent single-line loops
BinPackArguments: false
BinPackParameters: OnePerLine
BreakBeforeBraces: Attach # Attach braces to code block
BreakBeforeBinaryOperators: NonAssignment # Break before non-assignment operators
BreakBeforeTernaryOperators: true # Break before ternary operators
BreakConstructorInitializers: BeforeColon # Break constructor initializers before colon
BreakInheritanceList: BeforeColon # Break inheritance list before colon
InsertBraces: true # Automatically insert braces for clarity
PackConstructorInitializers: Never

# Language Features
AccessModifierOffset: -4 # Offset for access modifiers
Expand Down
3 changes: 3 additions & 0 deletions template/cxx/{{cookiecutter.project_slug}}/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ UseTab: Never # Exclusively use spaces for indentat
AllowShortIfStatementsOnASingleLine: Never # Prevent single-line if statements
AllowShortFunctionsOnASingleLine: Inline # Allow short functions on single line
AllowShortLoopsOnASingleLine: false # Prevent single-line loops
BinPackArguments: false
BinPackParameters: OnePerLine
BreakBeforeBraces: Attach # Attach braces to code block
BreakBeforeBinaryOperators: NonAssignment # Break before non-assignment operators
BreakBeforeTernaryOperators: true # Break before ternary operators
BreakConstructorInitializers: BeforeColon # Break constructor initializers before colon
BreakInheritanceList: BeforeColon # Break inheritance list before colon
InsertBraces: true # Automatically insert braces for clarity
PackConstructorInitializers: Never

# Language Features
AccessModifierOffset: -4 # Offset for access modifiers
Expand Down

0 comments on commit 37d3264

Please sign in to comment.