-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
45 lines (36 loc) · 1.22 KB
/
.clang-format
File metadata and controls
45 lines (36 loc) · 1.22 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
Language: Cpp
# Start with the Microsoft base style
BasedOnStyle: Microsoft
# Visual Studio Standard: Allman style (curly braces on new lines)
BreakBeforeBraces: Allman
# USE TABS INSTEAD OF SPACES
# UseTab: Always tells clang-format to use tab characters (\t)
# IndentWidth and TabWidth ensure the tabs appear as 4 columns wide
UseTab: Always
IndentWidth: 4
TabWidth: 4
# Align pointers to the type (int* p)
PointerAlignment: Left
# Access Modifiers (public/private)
# We pull modifiers back by 1 tab (4 columns) to align with the class definition
AccessModifierOffset: -4
# Indentation logic
IndentCaseLabels: true
IndentRequires: true
NamespaceIndentation: All
# Line breaking and Column limits
# Set to 0 to disable line wrapping, or keep 120 as a guideline
ColumnLimit: 120
# C++ Version
Standard: Latest
# Sort includes (mimics VS "Organize Imports" behavior)
SortIncludes: CaseInsensitive
# Specific Visual Studio nuances
AllowShortFunctionsOnASingleLine: Empty
BreakAfterAttributes: Always
BreakBeforeBinaryOperators: None
BreakConstructorInitializers: BeforeComma
FixNamespaceComments: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInParentheses: false