summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format104
1 files changed, 104 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..0929f7f
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,104 @@
+BasedOnStyle: LLVM
+Language: Cpp
+
+# -------------------------------------------------------------------
+# Indentation & layout
+# -------------------------------------------------------------------
+IndentWidth: 2
+TabWidth: 2
+UseTab: Never
+ContinuationIndentWidth: 2
+
+IndentCaseLabels: true
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentExternBlock: NoIndent
+
+# -------------------------------------------------------------------
+# Line breaking
+# -------------------------------------------------------------------
+ColumnLimit: 0
+
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowAllArgumentsOnNextLine: false
+
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+
+AlwaysBreakAfterReturnType: All
+AlwaysBreakTemplateDeclarations: No # harmless for C
+
+BreakBeforeBinaryOperators: None
+
+# -------------------------------------------------------------------
+# Braces (Allman style)
+# -------------------------------------------------------------------
+BreakBeforeBraces: Allman
+
+BraceWrapping:
+ AfterCaseLabel: true
+ BeforeElse: true
+ BeforeCatch: true
+ SplitEmptyFunction: true
+ SplitEmptyRecord: true
+ SplitEmptyNamespace: true
+
+# NOTE:
+# AfterControlStatement / AfterFunction / AfterStruct / AfterEnum / AfterUnion
+# are IMPLIED by Allman and must NOT be redundantly specified.
+
+# -------------------------------------------------------------------
+# Spacing
+# -------------------------------------------------------------------
+SpaceBeforeParens: ControlStatements
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeRangeBasedForLoopColon: true # ignored in C, harmless
+
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpacesInAngles: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+
+PointerAlignment: Right
+DerivePointerAlignment: false
+
+# -------------------------------------------------------------------
+# Alignment (explicitly disabled)
+# -------------------------------------------------------------------
+AlignAfterOpenBracket: DontAlign
+AlignOperands: false
+AlignTrailingComments: false
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: DontAlign
+
+# -------------------------------------------------------------------
+# Comments
+# -------------------------------------------------------------------
+ReflowComments: Never
+CommentPragmas: '^ dont touch:'
+KeepEmptyLinesAtTheStartOfBlocks: false
+MaxEmptyLinesToKeep: 1
+
+# -------------------------------------------------------------------
+# Includes
+# -------------------------------------------------------------------
+SortIncludes: Never
+IncludeBlocks: Preserve
+
+# -------------------------------------------------------------------
+# Macros & preprocessor
+# -------------------------------------------------------------------
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+SpaceAfterCStyleCast: false
+
+# -------------------------------------------------------------------
+# C-specific
+# -------------------------------------------------------------------
+Cpp11BracedListStyle: false
+DisableFormat: false