Skip to content

Commit 3dab84a

Browse files
authored
Update clang tool config files according to official guidelines [AP-3171] (#143)
See https://swift-nav.atlassian.net/wiki/spaces/QM/pages/3059089594/Software+Coding+Guidelines
1 parent af060fc commit 3dab84a

File tree

2 files changed

+399
-105
lines changed

2 files changed

+399
-105
lines changed

clang_format/.clang-format

Lines changed: 113 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,117 @@
1+
# These settings are based on the default Google style shipped with version 6.0
2+
# of clang-format, with a few minor tweaks.
3+
# Obtained by running `clang-format-6.0 -dump-config -style=Google`
14
# Complete list of style options can be found at:
25
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
36
---
4-
Language: Cpp
5-
BasedOnStyle: Google
6-
Standard: Cpp11
7-
BinPackParameters: false
8-
BinPackArguments: false
7+
Language: Cpp
8+
AccessModifierOffset: -1
9+
AlignAfterOpenBracket: Align
10+
AlignConsecutiveAssignments: false
11+
AlignConsecutiveDeclarations: false
12+
AlignEscapedNewlines: Left
13+
AlignOperands: true
14+
AlignTrailingComments: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortBlocksOnASingleLine: false
17+
AllowShortCaseLabelsOnASingleLine: false
18+
AllowShortFunctionsOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: true
20+
AllowShortLoopsOnASingleLine: true
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: true
24+
AlwaysBreakTemplateDeclarations: true
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterClass: false
29+
AfterControlStatement: false
30+
AfterEnum: false
31+
AfterFunction: false
32+
AfterNamespace: false
33+
AfterObjCDeclaration: false
34+
AfterStruct: false
35+
AfterUnion: false
36+
AfterExternBlock: false
37+
BeforeCatch: false
38+
BeforeElse: false
39+
IndentBraces: false
40+
SplitEmptyFunction: true
41+
SplitEmptyRecord: true
42+
SplitEmptyNamespace: true
43+
BreakBeforeBinaryOperators: None
44+
BreakBeforeBraces: Attach
45+
BreakBeforeInheritanceComma: false
46+
BreakBeforeTernaryOperators: true
47+
BreakConstructorInitializersBeforeComma: false
48+
BreakConstructorInitializers: BeforeColon
49+
BreakAfterJavaFieldAnnotations: false
50+
BreakStringLiterals: true
51+
ColumnLimit: 80
52+
CommentPragmas: '^ IWYU pragma:'
53+
CompactNamespaces: false
54+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
55+
ConstructorInitializerIndentWidth: 4
56+
ContinuationIndentWidth: 4
57+
Cpp11BracedListStyle: true
58+
DerivePointerAlignment: false
59+
DisableFormat: false
60+
ExperimentalAutoDetectBinPacking: false
61+
FixNamespaceComments: true
62+
ForEachMacros:
63+
- foreach
64+
- Q_FOREACH
65+
- BOOST_FOREACH
66+
IncludeBlocks: Preserve
67+
IncludeCategories:
68+
- Regex: '^<ext/.*\.h>'
69+
Priority: 2
70+
- Regex: '^<.*\.h>'
71+
Priority: 1
72+
- Regex: '^<.*'
73+
Priority: 2
74+
- Regex: '.*'
75+
Priority: 3
76+
IncludeIsMainRegex: '([-_](test|unittest))?$'
77+
IndentCaseLabels: true
78+
IndentPPDirectives: None
79+
IndentWidth: 2
80+
IndentWrappedFunctionNames: false
81+
JavaScriptQuotes: Leave
82+
JavaScriptWrapImports: true
83+
KeepEmptyLinesAtTheStartOfBlocks: false
84+
MacroBlockBegin: ''
85+
MacroBlockEnd: ''
86+
MaxEmptyLinesToKeep: 1
87+
NamespaceIndentation: None
88+
ObjCBlockIndentWidth: 2
89+
ObjCSpaceAfterProperty: false
90+
ObjCSpaceBeforeProtocolList: false
91+
PenaltyBreakAssignment: 2
92+
PenaltyBreakBeforeFirstCallParameter: 1
93+
PenaltyBreakComment: 300
94+
PenaltyBreakFirstLessLess: 120
95+
PenaltyBreakString: 1000
96+
PenaltyExcessCharacter: 1000000
97+
PenaltyReturnTypeOnItsOwnLine: 200
98+
PointerAlignment: Right
99+
ReflowComments: true
100+
SortIncludes: true
101+
SortUsingDeclarations: true
102+
SpaceAfterCStyleCast: false
103+
SpaceAfterTemplateKeyword: true
104+
SpaceBeforeAssignmentOperators: true
105+
SpaceBeforeParens: ControlStatements
106+
SpaceInEmptyParentheses: false
107+
SpacesBeforeTrailingComments: 2
108+
SpacesInAngles: false
109+
SpacesInContainerLiterals: true
110+
SpacesInCStyleCastParentheses: false
111+
SpacesInParentheses: false
112+
SpacesInSquareBrackets: false
113+
Standard: Cpp11
114+
TabWidth: 8
115+
UseTab: Never
9116
...
117+

0 commit comments

Comments
 (0)