forked from pgmoneta/pgmoneta
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
75 lines (62 loc) · 2.74 KB
/
.clang-format
File metadata and controls
75 lines (62 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This configuration is intended for clang-format >= 8.
BasedOnStyle: LLVM
# Indentation
IndentWidth: 3 # matches indent_columns = 3
TabWidth: 3 # matches input_tab_size/output_tab_size = 3
UseTab: Never # indent_with_tabs = 0 (spaces only)
ContinuationIndentWidth: 3 # keep wrapped lines on a single extra indent level
# Line length
ColumnLimit: 0 # code_width = 0 (no enforced wrapping)
# Pointers & references
# Let clang-format infer the dominant pointer style from existing code,
# instead of forcing \"type* name\" or \"type *name\" globally.
DerivePointerAlignment: true
# Spaces
SpaceBeforeParens: ControlStatements # "if (x)", "while (x)", but "func(x)"
SpacesInParentheses: false # sp_inside_paren = remove
SpacesInSquareBrackets: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false # e.g., (type*)ptr, not (type*) ptr
SpaceBeforeAssignmentOperators: true # sp_assign = force
SpaceBeforeRangeBasedForLoopColon: false
SpacesInAngles: false
# Braces / newlines around blocks
BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: false # keep "enum X {" as-is (nl_enum_brace = ignore)
AfterStruct: true # "struct X" then brace on its own line
AfterUnion: true # "union X" then brace on its own line
AfterFunction: true # Allman-style for function definitions
AfterControlStatement: true # Allman-style for if/for/while/switch/do
AfterCaseLabel: true # "case X:" then brace on its own line
BeforeElse: true # "else" on its own line after '}'
BeforeCatch: true
BeforeWhile: true # "while" on its own line after '}' in do-while
IndentBraces: false
# Switch / case, labels, and preprocessor
IndentCaseLabels: true # indent "case" relative to "switch"
IndentGotoLabels: false # keep labels like "error:" at column 0
IndentPPDirectives: None # keep #if/#ifdef at column 0, like current style
# Includes
SortIncludes: false # mod_sort_include = false
IncludeBlocks: Preserve # keep existing grouping and blank lines
# One-line constructs
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
# Alignment
AlignAfterOpenBracket: Align
AlignOperands: Align
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: AcrossEmptyLines
# Comments
ReflowComments: false # cmt_reflow_mode = 0, cmt_width = 0
KeepEmptyLinesAtTheStartOfBlocks: false
# Function signatures
AlwaysBreakAfterReturnType: AllDefinitions
# Misc packing and wrapping
BinPackArguments: true
BinPackParameters: true