-
Notifications
You must be signed in to change notification settings - Fork 673
Expand file tree
/
Copy path.clang-format
More file actions
35 lines (29 loc) · 854 Bytes
/
.clang-format
File metadata and controls
35 lines (29 loc) · 854 Bytes
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
---
Language: Proto
BasedOnStyle: Google
# Width & indentation
ColumnLimit: 100
IndentWidth: 2
TabWidth: 2
UseTab: Never
# Alignment for readability
AlignConsecutiveAssignments:
Enabled: true
AlignConsecutiveDeclarations:
Enabled: true
AlignOperands: AlignAfterOperator
AlignTrailingComments:
Kind: Always
# Keep multi-line constructs clear
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# Comment handling
ReflowComments: Always # wrap comments to ColumnLimit
# Protect specific comments (e.g., diagrams, formatted blocks) from reflow.
# Any comment line matching this regex will be preserved as-is.
CommentPragmas: '^[[:space:]]*(clang-format off|NOLINT|ASCII_ART|MARKDOWN)'
# Misc polish
SpaceBeforeAssignmentOperators: true
...