Skip to content

Commit e121b8f

Browse files
Re-sync with internal repository (#1619)
Co-authored-by: Facebook Community Bot <[email protected]>
1 parent efb164a commit e121b8f

File tree

2 files changed

+125
-1
lines changed

2 files changed

+125
-1
lines changed

folly/.clang-format

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# The canary clang-format config file.
2+
#
3+
# Changes from head:
4+
# - AllowAllParametersOfDeclarationOnNextLine: Safe
5+
# - AllowShortFunctionsOnASingleLine: Safe
6+
# - IncludeIsMainRegex: May cause errors, as it may reorder includes.
7+
# - IncludeCategories: May cause errors, as it may reorder includes.
8+
---
9+
AccessModifierOffset: -1
10+
AlignAfterOpenBracket: AlwaysBreak
11+
AlignConsecutiveMacros: false
12+
AlignConsecutiveAssignments: false
13+
AlignConsecutiveBitFields: false
14+
AlignConsecutiveDeclarations: false
15+
AlignEscapedNewlines: Left
16+
AlignOperands: DontAlign
17+
AlignTrailingComments: false
18+
AllowAllArgumentsOnNextLine: true
19+
AllowAllConstructorInitializersOnNextLine: true
20+
AllowAllParametersOfDeclarationOnNextLine: true
21+
AllowShortEnumsOnASingleLine: true
22+
AllowShortBlocksOnASingleLine: Never
23+
AllowShortCaseLabelsOnASingleLine: false
24+
AllowShortFunctionsOnASingleLine: Inline
25+
AllowShortLambdasOnASingleLine: All
26+
AllowShortIfStatementsOnASingleLine: Never
27+
AllowShortLoopsOnASingleLine: false
28+
AlwaysBreakAfterReturnType: None
29+
AlwaysBreakBeforeMultilineStrings: true
30+
AlwaysBreakTemplateDeclarations: Yes
31+
BinPackArguments: false
32+
BinPackParameters: false
33+
BreakBeforeBinaryOperators: None
34+
BreakBeforeBraces: Attach
35+
BreakInheritanceList: BeforeColon
36+
BreakBeforeTernaryOperators: true
37+
BreakConstructorInitializers: BeforeColon
38+
BreakAfterJavaFieldAnnotations: false
39+
BreakStringLiterals: false
40+
ColumnLimit: 80
41+
CommentPragmas: '^ IWYU pragma:'
42+
CompactNamespaces: false
43+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
44+
ConstructorInitializerIndentWidth: 4
45+
ContinuationIndentWidth: 4
46+
Cpp11BracedListStyle: true
47+
DeriveLineEnding: true
48+
DerivePointerAlignment: false
49+
DisableFormat: false
50+
FixNamespaceComments: true
51+
ForEachMacros:
52+
- FOR_EACH
53+
- FOR_EACH_R
54+
- FOR_EACH_RANGE
55+
IncludeBlocks: Preserve
56+
IncludeCategories:
57+
- Regex: '^<(sodium|Python)\.h>$'
58+
Priority: 3
59+
- Regex: '^<((arpa|net|netinet|sys|linux)\/)?[-_[:alnum:]]+\.h>$'
60+
Priority: 1
61+
- Regex: '^<[\/-_[:alnum:]]+>$'
62+
Priority: 2
63+
- Regex: '^<((bistro|caffe2|cachelib|fatal|fb303|faiss|fbmeshd|fboss|fbzmq|fizz|folly|gloo|hphp|logdevice|magma|mcrouter|openr|proxygen|quic|rsocket|scape|squangle|tensorpipe|thrift|wangle|wdt|yarpl)\/).*>$'
64+
Priority: 4
65+
- Regex: '^<.*>$'
66+
Priority: 3
67+
- Regex: '.*'
68+
Priority: 5
69+
IncludeIsMainRegex: '((Test|Tests|_test|Bench|Benchmark|Performance)[0-9]*)?$'
70+
IndentCaseLabels: true
71+
IndentCaseBlocks: false
72+
IndentGotoLabels: true
73+
IndentPPDirectives: None
74+
IndentExternBlock: AfterExternBlock
75+
IndentWidth: 2
76+
IndentWrappedFunctionNames: false
77+
InsertTrailingCommas: None
78+
JavaScriptQuotes: Leave
79+
JavaScriptWrapImports: true
80+
KeepEmptyLinesAtTheStartOfBlocks: false
81+
MacroBlockBegin: ''
82+
MacroBlockEnd: ''
83+
MaxEmptyLinesToKeep: 1
84+
NamespaceIndentation: None
85+
ObjCBinPackProtocolList: Auto
86+
ObjCBlockIndentWidth: 2
87+
ObjCBreakBeforeNestedBlockParam: true
88+
ObjCSpaceAfterProperty: false
89+
ObjCSpaceBeforeProtocolList: false
90+
PenaltyBreakAssignment: 2
91+
PenaltyBreakBeforeFirstCallParameter: 1
92+
PenaltyBreakComment: 300
93+
PenaltyBreakFirstLessLess: 120
94+
PenaltyBreakString: 1000
95+
PenaltyBreakTemplateDeclaration: 10
96+
PenaltyExcessCharacter: 1000000
97+
PenaltyReturnTypeOnItsOwnLine: 200
98+
PointerAlignment: Left
99+
ReflowComments: true
100+
SortIncludes: true
101+
SortUsingDeclarations: true
102+
SpaceAfterCStyleCast: false
103+
SpaceAfterLogicalNot: false
104+
SpaceAfterTemplateKeyword: true
105+
SpaceBeforeAssignmentOperators: true
106+
SpaceBeforeCpp11BracedList: false
107+
SpaceBeforeCtorInitializerColon: true
108+
SpaceBeforeInheritanceColon: true
109+
SpaceBeforeParens: ControlStatements
110+
SpaceBeforeRangeBasedForLoopColon: true
111+
SpaceInEmptyBlock: false
112+
SpaceInEmptyParentheses: false
113+
SpacesBeforeTrailingComments: 1
114+
SpacesInAngles: false
115+
SpacesInConditionalStatement: false
116+
SpacesInContainerLiterals: true
117+
SpacesInCStyleCastParentheses: false
118+
SpacesInParentheses: false
119+
SpacesInSquareBrackets: false
120+
SpaceBeforeSquareBrackets: false
121+
Standard: Latest
122+
TabWidth: 8
123+
UseCRLF: false
124+
UseTab: Never
125+
...

folly/io/IOBuf.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ unique_ptr<IOBuf> IOBuf::takeOwnership(
476476

477477
// do not allow only user data without a freeFn
478478
// since we use that for folly::sizedFree
479-
480479
DCHECK(
481480
!userData || (userData && freeFn) ||
482481
(userData && !freeFn && (option == TakeOwnershipOption::STORE_SIZE)));

0 commit comments

Comments
 (0)