Skip to content

Commit 2e8f3ad

Browse files
committed
formatting: add verbose .clang-format defining GR code style
This implements the GREP0011 for formatting. Detailed discussion was been carried out in PR gnuradio#1664.
1 parent 546c02b commit 2e8f3ad

File tree

1 file changed

+94
-10
lines changed

1 file changed

+94
-10
lines changed

.clang-format

+94-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,104 @@
11
---
2-
BasedOnStyle: LLVM
3-
IndentWidth: 4
4-
---
52
Language: Cpp
6-
BasedOnStyle: LLVM
7-
IndentWidth: 4
8-
AccessModifierOffset: 0
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
95
AlignAfterOpenBracket: Align
10-
#AlignEscapedNewlines: Left
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
1110
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
1220
AlwaysBreakTemplateDeclarations: true
1321
BinPackArguments: false
1422
BinPackParameters: false
15-
ColumnLimit: 100
16-
#FixNamespaceComments: true
23+
BreakBeforeBraces: Custom
24+
BraceWrapping:
25+
AfterClass: true
26+
AfterControlStatement: false
27+
AfterEnum: false
28+
AfterFunction: true
29+
AfterNamespace: false
30+
AfterObjCDeclaration: false
31+
AfterStruct: false
32+
AfterUnion: false
33+
BeforeCatch: false
34+
BeforeElse: false
35+
IndentBraces: false
36+
BreakBeforeBinaryOperators: None
37+
BreakBeforeTernaryOperators: true
38+
BreakConstructorInitializersBeforeComma: false
39+
BreakAfterJavaFieldAnnotations: false
40+
BreakStringLiterals: true
41+
ColumnLimit: 90
42+
CommentPragmas: '^ IWYU pragma:'
43+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
44+
ConstructorInitializerIndentWidth: 4
45+
ContinuationIndentWidth: 4
46+
Cpp11BracedListStyle: false
47+
DerivePointerAlignment: false
48+
DisableFormat: false
49+
ExperimentalAutoDetectBinPacking: false
50+
ForEachMacros:
51+
- foreach
52+
- Q_FOREACH
53+
- BOOST_FOREACH
54+
IncludeCategories:
55+
- Regex: '^"(gnuradio)/'
56+
Priority: 1
57+
- Regex: '^<(gnuradio)/'
58+
Priority: 2
59+
- Regex: '^<(boost)/'
60+
Priority: 98
61+
- Regex: '^<[a-z]*>$'
62+
Priority: 99
63+
- Regex: '^".*"$'
64+
Priority: 0
65+
- Regex: '.*'
66+
Priority: 10
67+
68+
IncludeIsMainRegex: '(Test)?$'
69+
IndentCaseLabels: false
70+
IndentWidth: 4
71+
IndentWrappedFunctionNames: false
72+
JavaScriptQuotes: Leave
73+
JavaScriptWrapImports: true
74+
KeepEmptyLinesAtTheStartOfBlocks: true
75+
MacroBlockBegin: ''
76+
MacroBlockEnd: ''
1777
MaxEmptyLinesToKeep: 2
18-
#CompactNamespaces: true
1978
NamespaceIndentation: None
79+
ObjCBlockIndentWidth: 2
80+
ObjCSpaceAfterProperty: false
81+
ObjCSpaceBeforeProtocolList: true
82+
PenaltyBreakBeforeFirstCallParameter: 19
83+
PenaltyBreakComment: 300
84+
PenaltyBreakFirstLessLess: 120
85+
PenaltyBreakString: 1000
86+
PenaltyExcessCharacter: 1000000
87+
PenaltyReturnTypeOnItsOwnLine: 60
2088
PointerAlignment: Left
89+
ReflowComments: true
90+
SortIncludes: true
91+
SpaceAfterCStyleCast: false
92+
SpaceAfterTemplateKeyword: true
93+
SpaceBeforeAssignmentOperators: true
94+
SpaceBeforeParens: ControlStatements
95+
SpaceInEmptyParentheses: false
96+
SpacesBeforeTrailingComments: 1
97+
SpacesInAngles: false
98+
SpacesInContainerLiterals: true
99+
SpacesInCStyleCastParentheses: false
100+
SpacesInParentheses: false
101+
SpacesInSquareBrackets: false
102+
Standard: Cpp11
103+
TabWidth: 8
104+
UseTab: Never

0 commit comments

Comments
 (0)