Skip to content

Commit

Permalink
Add clang-format configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Jul 4, 2024
1 parent eff7ad4 commit bb6ace4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
Language: Cpp
IndentWidth: 4
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignArrayOfStructures: Left
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
BraceWrapping:
BeforeWhile: true
BreakBeforeBraces: Allman
ColumnLimit: 120
IncludeBlocks: Preserve
IndentCaseBlocks: true
IndentCaseLabels: true
InsertBraces: true
PackConstructorInitializers: Never
PointerAlignment: Left
ReferenceAlignment: Left
SeparateDefinitionBlocks: Always
SortIncludes: CaseSensitive
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterFunctionDefinitionName: false
SpaceBeforeRangeBasedForLoopColon: true
SpacesInAngles: Never
SpacesInParentheses: false
5 changes: 5 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

REPO_DIR=$(realpath $(dirname $0))

find "$REPO_DIR/src" -iname "*.[ch]pp" -exec clang-format-15 --style=file:"$REPO_DIR/.clang-format" -i {} \;

0 comments on commit bb6ace4

Please sign in to comment.