summaryrefslogtreecommitdiff
path: root/library/clang-format
diff options
context:
space:
mode:
Diffstat (limited to 'library/clang-format')
-rw-r--r--library/clang-format104
1 files changed, 104 insertions, 0 deletions
diff --git a/library/clang-format b/library/clang-format
new file mode 100644
index 0000000..3c61d5e
--- /dev/null
+++ b/library/clang-format
@@ -0,0 +1,104 @@
1BasedOnStyle: LLVM
2Language: C
3
4# -------------------------------------------------------------------
5# Indentation & layout
6# -------------------------------------------------------------------
7IndentWidth: 2
8TabWidth: 2
9UseTab: Never
10ContinuationIndentWidth: 2
11
12IndentCaseLabels: true
13IndentGotoLabels: true
14IndentPPDirectives: None
15IndentExternBlock: NoIndent
16
17# -------------------------------------------------------------------
18# Line breaking
19# -------------------------------------------------------------------
20ColumnLimit: 0
21
22AllowAllParametersOfDeclarationOnNextLine: false
23AllowAllArgumentsOnNextLine: false
24
25AllowShortFunctionsOnASingleLine: false
26AllowShortIfStatementsOnASingleLine: Never
27AllowShortLoopsOnASingleLine: false
28AllowShortBlocksOnASingleLine: Never
29AllowShortCaseLabelsOnASingleLine: false
30
31AlwaysBreakAfterReturnType: All
32AlwaysBreakTemplateDeclarations: No # harmless for C
33
34BreakBeforeBinaryOperators: None
35
36# -------------------------------------------------------------------
37# Braces (Allman style)
38# -------------------------------------------------------------------
39BreakBeforeBraces: Allman
40
41BraceWrapping:
42 AfterCaseLabel: true
43 BeforeElse: true
44 BeforeCatch: true
45 SplitEmptyFunction: true
46 SplitEmptyRecord: true
47 SplitEmptyNamespace: true
48
49# NOTE:
50# AfterControlStatement / AfterFunction / AfterStruct / AfterEnum / AfterUnion
51# are IMPLIED by Allman and must NOT be redundantly specified.
52
53# -------------------------------------------------------------------
54# Spacing
55# -------------------------------------------------------------------
56SpaceBeforeParens: ControlStatements
57SpaceBeforeAssignmentOperators: true
58SpaceBeforeRangeBasedForLoopColon: true # ignored in C, harmless
59
60SpacesInParentheses: false
61SpacesInSquareBrackets: false
62SpacesInAngles: false
63SpaceInEmptyParentheses: false
64SpacesBeforeTrailingComments: 1
65
66PointerAlignment: Right
67DerivePointerAlignment: false
68
69# -------------------------------------------------------------------
70# Alignment (explicitly disabled)
71# -------------------------------------------------------------------
72AlignAfterOpenBracket: DontAlign
73AlignOperands: false
74AlignTrailingComments: false
75AlignConsecutiveAssignments: false
76AlignConsecutiveDeclarations: false
77AlignEscapedNewlines: DontAlign
78
79# -------------------------------------------------------------------
80# Comments
81# -------------------------------------------------------------------
82ReflowComments: false
83CommentPragmas: '^ dont touch:'
84KeepEmptyLinesAtTheStartOfBlocks: false
85MaxEmptyLinesToKeep: 1
86
87# -------------------------------------------------------------------
88# Includes
89# -------------------------------------------------------------------
90SortIncludes: Never
91IncludeBlocks: Preserve
92
93# -------------------------------------------------------------------
94# Macros & preprocessor
95# -------------------------------------------------------------------
96MacroBlockBegin: ''
97MacroBlockEnd: ''
98SpaceAfterCStyleCast: false
99
100# -------------------------------------------------------------------
101# C-specific
102# -------------------------------------------------------------------
103Cpp11BracedListStyle: false
104DisableFormat: false