Skip to content

Commit

Permalink
feat: auto-formatting with clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Feb 9, 2024
1 parent 77bc601 commit c03d6e2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
BasedOnStyle: LLVM
Standard: Auto
ColumnLimit: 0

# parentheses, braces, etc.
Cpp11BracedListStyle: true
SpaceAfterControlStatementKeyword: false
BreakConstructorInitializersBeforeComma: true
FixNamespaceComments: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

# alignment
PointerAlignment: Left
ReferenceAlignment: Left
NamespaceIndentation: All
AlignConsecutiveAssignments: true
AlignTrailingComments: false

# indentation
UseTab: Never
IndentAccessModifiers: true

# empty lines
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
SeparateDefinitionBlocks: Leave
EmptyLineAfterAccessModifier: Leave
EmptyLineBeforeAccessModifier: Leave

# linebreaks
AllowShortEnumsOnASingleLine: true
...
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples/build_with_*/*.cc

0 comments on commit c03d6e2

Please sign in to comment.