summaryrefslogtreecommitdiff
path: root/.clang-format
blob: 2529c27d2e37f99320473225d565f065ee8e46cc (plain)
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
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 2
UseTab: Never
ColumnLimit: 80

# From CONTRIBUTING.md: "The keyword 'public', 'protected', 'private' should be intended 1 character less than the methods."
# IndentWidth is 2, so AccessModifierOffset -1 results in indentation of 1.
AccessModifierOffset: -1

# From CONTRIBUTING.md: "prefer const T* name to const T *name"
PointerAlignment: Left
DerivePointerAlignment: false

# From CONTRIBUTING.md: "keep the code compact vertically... Use only one statement per line."
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false

# From CONTRIBUTING.md: "put spaces around code and operators (cosmetics)"
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

# Misc improvements
AlwaysBreakBeforeMultilineStrings: true
FixNamespaceComments: true
SortIncludes: true
Standard: Latest