Skip to content

Commit 9881d3d

Browse files
c-p-i-ofacebook-github-bot
authored andcommitted
Back out "fbcode/gloo/examples" (#404)
Summary: Put back example files that were deleted by codemod because they didn't have a TARGET Reviewed By: fduwjj Differential Revision: D69182638
1 parent b67ecd8 commit 9881d3d

File tree

7 files changed

+781
-5
lines changed

7 files changed

+781
-5
lines changed

.github/config/lint/.clang-format

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
CompactNamespaces: false
41+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
42+
ConstructorInitializerIndentWidth: 4
43+
ContinuationIndentWidth: 4
44+
Cpp11BracedListStyle: true
45+
DerivePointerAlignment: false
46+
DisableFormat: false
47+
ForEachMacros:
48+
- FOR_EACH_RANGE
49+
- FOR_EACH
50+
IncludeCategories:
51+
- Regex: '^<.*\.h(pp)?>'
52+
Priority: 1
53+
- Regex: '^<.*'
54+
Priority: 2
55+
- Regex: '.*'
56+
Priority: 3
57+
IndentCaseLabels: true
58+
IndentWidth: 2
59+
IndentWrappedFunctionNames: false
60+
KeepEmptyLinesAtTheStartOfBlocks: false
61+
MacroBlockBegin: ''
62+
MacroBlockEnd: ''
63+
Macros:
64+
- >-
65+
PyObject_HEAD_INIT(type)={
66+
/* this is not exactly match with PyObject_HEAD_INIT in Python source code
67+
* but it is enough for clang-format */
68+
{ 0xFFFFFFFF },
69+
(type)
70+
},
71+
- >-
72+
PyVarObject_HEAD_INIT(type, size)={
73+
{
74+
/* manually expand PyObject_HEAD_INIT(type) above
75+
* because clang-format do not support recursive expansion */
76+
{ 0xFFFFFFFF },
77+
(type)
78+
},
79+
(size)
80+
},
81+
MaxEmptyLinesToKeep: 1
82+
NamespaceIndentation: None
83+
PenaltyBreakBeforeFirstCallParameter: 1
84+
PenaltyBreakComment: 300
85+
PenaltyBreakFirstLessLess: 120
86+
PenaltyBreakString: 1000
87+
PenaltyExcessCharacter: 1000000
88+
PenaltyReturnTypeOnItsOwnLine: 2000000
89+
PointerAlignment: Left
90+
ReflowComments: true
91+
SortIncludes: true
92+
SpaceAfterCStyleCast: false
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: c++17
103+
StatementMacros:
104+
- C10_DEFINE_bool
105+
- C10_DEFINE_int
106+
- C10_DEFINE_int32
107+
- C10_DEFINE_int64
108+
- C10_DEFINE_string
109+
- C10_DEFINE_REGISTRY_WITHOUT_WARNING
110+
- C10_REGISTER_CREATOR
111+
- DEFINE_BINARY
112+
- PyObject_HEAD
113+
- PyObject_VAR_HEAD
114+
- PyException_HEAD
115+
- TORCH_DECLARE_bool
116+
117+
TabWidth: 8
118+
UseTab: Never
119+
---
120+
Language: ObjC
121+
ColumnLimit: 120
122+
AlignAfterOpenBracket: Align
123+
ObjCBlockIndentWidth: 2
124+
ObjCSpaceAfterProperty: false
125+
ObjCSpaceBeforeProtocolList: false
126+
...

.github/workflows/build-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ jobs:
5555
- name: Install googletest
5656
run: |
5757
conda activate py376_build
58-
curl https://codeload.github.com/google/googletest/tar.gz/release-1.10.0 --output `
59-
googletest-release-1.10.0.tar.gz
60-
tar xzvf googletest-release-1.10.0.tar.gz
61-
cd googletest-release-1.10.0
58+
curl -L https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz `
59+
--output googletest-1-15.2.tar.gz
60+
tar xzvf googletest-1.15.2.tar.gz
61+
cd googletest-1.15.2
6262
mkdir -p build
6363
cd build
6464
if (Test-Path -Path ${{ env.gtest_lib_path }}) {

gloo/.clang-format

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
CompactNamespaces: false
41+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
42+
ConstructorInitializerIndentWidth: 4
43+
ContinuationIndentWidth: 4
44+
Cpp11BracedListStyle: true
45+
DerivePointerAlignment: false
46+
DisableFormat: false
47+
ForEachMacros:
48+
- FOR_EACH_RANGE
49+
- FOR_EACH
50+
IncludeCategories:
51+
- Regex: '^<.*\.h(pp)?>'
52+
Priority: 1
53+
- Regex: '^<.*'
54+
Priority: 2
55+
- Regex: '.*'
56+
Priority: 3
57+
IndentCaseLabels: true
58+
IndentWidth: 2
59+
IndentWrappedFunctionNames: false
60+
KeepEmptyLinesAtTheStartOfBlocks: false
61+
MacroBlockBegin: ''
62+
MacroBlockEnd: ''
63+
Macros:
64+
- >-
65+
PyObject_HEAD_INIT(type)={
66+
/* this is not exactly match with PyObject_HEAD_INIT in Python source code
67+
* but it is enough for clang-format */
68+
{ 0xFFFFFFFF },
69+
(type)
70+
},
71+
- >-
72+
PyVarObject_HEAD_INIT(type, size)={
73+
{
74+
/* manually expand PyObject_HEAD_INIT(type) above
75+
* because clang-format do not support recursive expansion */
76+
{ 0xFFFFFFFF },
77+
(type)
78+
},
79+
(size)
80+
},
81+
MaxEmptyLinesToKeep: 1
82+
NamespaceIndentation: None
83+
PenaltyBreakBeforeFirstCallParameter: 1
84+
PenaltyBreakComment: 300
85+
PenaltyBreakFirstLessLess: 120
86+
PenaltyBreakString: 1000
87+
PenaltyExcessCharacter: 1000000
88+
PenaltyReturnTypeOnItsOwnLine: 2000000
89+
PointerAlignment: Left
90+
ReflowComments: true
91+
SortIncludes: true
92+
SpaceAfterCStyleCast: false
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: c++17
103+
StatementMacros:
104+
- C10_DEFINE_bool
105+
- C10_DEFINE_int
106+
- C10_DEFINE_int32
107+
- C10_DEFINE_int64
108+
- C10_DEFINE_string
109+
- C10_DEFINE_REGISTRY_WITHOUT_WARNING
110+
- C10_REGISTER_CREATOR
111+
- DEFINE_BINARY
112+
- PyObject_HEAD
113+
- PyObject_VAR_HEAD
114+
- PyException_HEAD
115+
- TORCH_DECLARE_bool
116+
117+
TabWidth: 8
118+
UseTab: Never
119+
---
120+
Language: ObjC
121+
ColumnLimit: 120
122+
AlignAfterOpenBracket: Align
123+
ObjCBlockIndentWidth: 2
124+
ObjCSpaceAfterProperty: false
125+
ObjCSpaceBeforeProtocolList: false
126+
...

gloo/examples/example1.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <iostream>
66
#include <memory>
7+
#include <string>
8+
#include <vector>
79

810
#include "gloo/allreduce_ring.h"
911
#include "gloo/rendezvous/context.h"
@@ -55,7 +57,8 @@ int main(void) {
5557

5658
// attr.ai_family = AF_INET; // Force IPv4
5759
// attr.ai_family = AF_INET6; // Force IPv6
58-
attr.ai_family = AF_UNSPEC; // Use either (default)
60+
// Use either (default)
61+
attr.ai_family = AF_UNSPEC;
5962

6063
// A string is implicitly converted to an "attr" struct with its
6164
// hostname field populated. This will try to resolve the interface

0 commit comments

Comments
 (0)