Skip to content

Commit 463086b

Browse files
author
Kai Liu
committed
Add clang-format rules
Summary: The rule file is forked from that in Facebook's repo. I'll add format file for now and team members can tune the rules later. In this patch, I made only two changes in order to be consistent with existing coding style `SpacesBeforeTrailingComments: 2` `ColumnLimit: 80` Test Plan: N/A Reviewers: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D15015
1 parent 4695059 commit 463086b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.clang-format

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Complete list of style options can be found at:
2+
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
---
4+
BasedOnStyle: Google
5+
AccessModifierOffset: -1
6+
ConstructorInitializerIndentWidth: 4
7+
AlignEscapedNewlinesLeft: true
8+
AlignTrailingComments: true
9+
AllowAllParametersOfDeclarationOnNextLine: true
10+
AllowShortIfStatementsOnASingleLine: false
11+
AllowShortLoopsOnASingleLine: false
12+
AlwaysBreakTemplateDeclarations: true
13+
AlwaysBreakBeforeMultilineStrings: true
14+
BreakBeforeBinaryOperators: false
15+
BreakConstructorInitializersBeforeComma: false
16+
BinPackParameters: false
17+
ColumnLimit: 80
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: true
20+
ExperimentalAutoDetectBinPacking: true
21+
IndentCaseLabels: false
22+
MaxEmptyLinesToKeep: 1
23+
NamespaceIndentation: None
24+
ObjCSpaceBeforeProtocolList: false
25+
PenaltyBreakBeforeFirstCallParameter: 10
26+
PenaltyBreakComment: 60
27+
PenaltyBreakString: 1000
28+
PenaltyBreakFirstLessLess: 20
29+
PenaltyExcessCharacter: 1000000
30+
PenaltyReturnTypeOnItsOwnLine: 200
31+
PointerBindsToType: true
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: true
34+
Standard: Cpp11
35+
IndentWidth: 2
36+
TabWidth: 8
37+
UseTab: Never
38+
BreakBeforeBraces: Attach
39+
IndentFunctionDeclarationAfterType: false
40+
SpacesInParentheses: false
41+
SpacesInAngles: false
42+
SpaceInEmptyParentheses: false
43+
SpacesInCStyleCastParentheses: false
44+
SpaceAfterControlStatementKeyword: true
45+
SpaceBeforeAssignmentOperators: true
46+
ContinuationIndentWidth: 4
47+
...

0 commit comments

Comments
 (0)