forked from timescale/pg_textsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
101 lines (88 loc) · 2.52 KB
/
Copy path.clang-format
File metadata and controls
101 lines (88 loc) · 2.52 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
# PostgreSQL-style C formatting for Tapir extension
# Optimized for 79-character line limit with proper alignment
BasedOnStyle: LLVM
# Basic formatting
ColumnLimit: 79
IndentWidth: 4
TabWidth: 4
UseTab: Always
ContinuationIndentWidth: 8
# Function formatting (key for PostgreSQL style)
AllowAllParametersOfDeclarationOnNextLine: true
AllowAllArgumentsOnNextLine: true
AlwaysBreakAfterReturnType: AllDefinitions
BinPackArguments: false
BinPackParameters: false
IndentWrappedFunctionNames: false
# Alignment (PostgreSQL style with macro alignment)
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
# Braces (PostgreSQL style: opening brace on new line)
BreakBeforeBraces: Allman
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# Spacing
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Comments and strings
ReflowComments: true
BreakStringLiterals: true
# Pointer alignment
PointerAlignment: Right
DerivePointerAlignment: false
# Include handling (postgres.h first, then system, then local with blank lines)
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
# Disable main file priority to treat all quoted includes equally
IncludeIsMainRegex: '$^'
IncludeCategories:
- Regex: '^<postgres\.h>'
Priority: -3
SortPriority: -3
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 1
- Regex: '^".*\.h"'
Priority: 2
SortPriority: 2
# PostgreSQL-specific macros
ForEachMacros:
- foreach
- forboth
- for_each_cell
- for_both_cell
- forthree
- MemSet
- MemSetAligned
- MemSetLoop
# Switch/case formatting
IndentCaseLabels: false
# Penalty tuning for better line breaks
PenaltyBreakAssignment: 100
PenaltyBreakBeforeFirstCallParameter: 200
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 75
# Other formatting
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
CompactNamespaces: false
# Encourage blank lines around function declarations
SeparateDefinitionBlocks: Always