Skip to content

Commit a7d6128

Browse files
committed
Improved .clang_format file.
1 parent d55bbd4 commit a7d6128

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.clang-format

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,35 @@
66
# Note that clang-format cannot express the style that closing parentheses
77
# behave similar to closing curly braces in a multi-line setting in that
88
# they have to be on a line of their own at the same indentation level
9-
# as the opening part.
9+
# as the opening part (aka "dangling parenthesis", see https://reviews.llvm.org/D33029).
1010

1111
Language: Cpp
1212
BasedOnStyle: LLVM
13+
AccessModifierOffset: -4
14+
AlignAfterOpenBracket: AlwaysBreak
1315
AlignEscapedNewlinesLeft: true
1416
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakTemplateDeclarations: Yes
1518
BinPackArguments: false
1619
BinPackParameters: false
1720
BreakBeforeBinaryOperators: All
1821
BreakBeforeBraces: Allman
1922
ColumnLimit: 120
2023
ContinuationIndentWidth: 4
24+
FixNamespaceComments: false
2125
IndentWidth: 4
2226
KeepEmptyLinesAtTheStartOfBlocks: false
2327
MaxEmptyLinesToKeep: 2
2428
PenaltyBreakBeforeFirstCallParameter: 2000
29+
PointerAlignment: Left
2530
SpaceAfterCStyleCast: true
31+
SpaceAfterTemplateKeyword: false
32+
SpaceBeforeCtorInitializerColon: false
33+
SpaceBeforeInheritanceColon: false
2634
SpaceBeforeParens: ControlStatements
35+
SpaceBeforeRangeBasedForLoopColon: false
2736
TabWidth: 4
28-
UseTab: ForIndentation
37+
UseTab: Always
2938

3039
# Local Variables:
3140
# mode: yaml

CODING_STYLE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct MeanSigma
141141
double const d = 0;
142142
int i = 0;
143143
int j = 0;
144-
char* s;
144+
char* s = nullptr;
145145
MeanAndSigma ms meanAndSigma(std::vector<float> const& _v, Accuracy _a);
146146
Derived* x = dynamic_cast<Derived*>(base);
147147
for (auto i = x->begin(); i != x->end(); ++i) {}

0 commit comments

Comments
 (0)