Skip to content

Commit 9d87046

Browse files
committed
first commit
1 parent 4df7366 commit 9d87046

File tree

781 files changed

+225888
-6184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

781 files changed

+225888
-6184
lines changed

.clang-format

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveMacros: None
8+
AlignConsecutiveAssignments: None
9+
AlignConsecutiveBitFields: None
10+
AlignConsecutiveDeclarations: None
11+
AlignEscapedNewlines: Right
12+
AlignOperands: Align
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: true
17+
AllowShortEnumsOnASingleLine: true
18+
AllowShortBlocksOnASingleLine: Never
19+
AllowShortCaseLabelsOnASingleLine: false
20+
AllowShortFunctionsOnASingleLine: All
21+
AllowShortLambdasOnASingleLine: All
22+
AllowShortIfStatementsOnASingleLine: Never
23+
AllowShortLoopsOnASingleLine: false
24+
AlwaysBreakAfterDefinitionReturnType: None
25+
AlwaysBreakAfterReturnType: None
26+
AlwaysBreakBeforeMultilineStrings: false
27+
AlwaysBreakTemplateDeclarations: MultiLine
28+
AttributeMacros:
29+
- __capability
30+
BinPackArguments: true
31+
BinPackParameters: true
32+
BraceWrapping:
33+
AfterCaseLabel: false
34+
AfterClass: false
35+
AfterControlStatement: Never
36+
AfterEnum: false
37+
AfterFunction: false
38+
AfterNamespace: false
39+
AfterObjCDeclaration: false
40+
AfterStruct: false
41+
AfterUnion: false
42+
AfterExternBlock: false
43+
BeforeCatch: false
44+
BeforeElse: false
45+
BeforeLambdaBody: false
46+
BeforeWhile: false
47+
IndentBraces: false
48+
SplitEmptyFunction: true
49+
SplitEmptyRecord: true
50+
SplitEmptyNamespace: true
51+
BreakBeforeBinaryOperators: None
52+
BreakBeforeConceptDeclarations: true
53+
BreakBeforeBraces: Attach
54+
BreakBeforeInheritanceComma: false
55+
BreakInheritanceList: BeforeColon
56+
BreakBeforeTernaryOperators: true
57+
BreakConstructorInitializersBeforeComma: false
58+
BreakConstructorInitializers: BeforeColon
59+
BreakAfterJavaFieldAnnotations: false
60+
BreakStringLiterals: true
61+
ColumnLimit: 80
62+
CommentPragmas: '^ IWYU pragma:'
63+
CompactNamespaces: false
64+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
65+
ConstructorInitializerIndentWidth: 4
66+
ContinuationIndentWidth: 4
67+
Cpp11BracedListStyle: true
68+
DeriveLineEnding: true
69+
DerivePointerAlignment: false
70+
DisableFormat: false
71+
EmptyLineAfterAccessModifier: Never
72+
EmptyLineBeforeAccessModifier: LogicalBlock
73+
ExperimentalAutoDetectBinPacking: false
74+
FixNamespaceComments: true
75+
ForEachMacros:
76+
- foreach
77+
- Q_FOREACH
78+
- BOOST_FOREACH
79+
IfMacros:
80+
- KJ_IF_MAYBE
81+
IncludeBlocks: Preserve
82+
IncludeCategories:
83+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
84+
Priority: 2
85+
SortPriority: 0
86+
CaseSensitive: false
87+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
88+
Priority: 3
89+
SortPriority: 0
90+
CaseSensitive: false
91+
- Regex: '.*'
92+
Priority: 1
93+
SortPriority: 0
94+
CaseSensitive: false
95+
IncludeIsMainRegex: '(Test)?$'
96+
IncludeIsMainSourceRegex: ''
97+
IndentAccessModifiers: false
98+
IndentCaseLabels: false
99+
IndentCaseBlocks: false
100+
IndentGotoLabels: true
101+
IndentPPDirectives: None
102+
IndentExternBlock: AfterExternBlock
103+
IndentRequires: false
104+
IndentWidth: 2
105+
IndentWrappedFunctionNames: false
106+
InsertTrailingCommas: None
107+
JavaScriptQuotes: Leave
108+
JavaScriptWrapImports: true
109+
KeepEmptyLinesAtTheStartOfBlocks: true
110+
LambdaBodyIndentation: Signature
111+
MacroBlockBegin: ''
112+
MacroBlockEnd: ''
113+
MaxEmptyLinesToKeep: 1
114+
NamespaceIndentation: None
115+
ObjCBinPackProtocolList: Auto
116+
ObjCBlockIndentWidth: 2
117+
ObjCBreakBeforeNestedBlockParam: true
118+
ObjCSpaceAfterProperty: false
119+
ObjCSpaceBeforeProtocolList: true
120+
PenaltyBreakAssignment: 2
121+
PenaltyBreakBeforeFirstCallParameter: 19
122+
PenaltyBreakComment: 300
123+
PenaltyBreakFirstLessLess: 120
124+
PenaltyBreakString: 1000
125+
PenaltyBreakTemplateDeclaration: 10
126+
PenaltyExcessCharacter: 1000000
127+
PenaltyReturnTypeOnItsOwnLine: 60
128+
PenaltyIndentedWhitespace: 0
129+
PointerAlignment: Left
130+
PPIndentWidth: -1
131+
ReferenceAlignment: Pointer
132+
ReflowComments: true
133+
ShortNamespaceLines: 1
134+
SortIncludes: CaseSensitive
135+
SortJavaStaticImport: Before
136+
SortUsingDeclarations: true
137+
SpaceAfterCStyleCast: false
138+
SpaceAfterLogicalNot: false
139+
SpaceAfterTemplateKeyword: true
140+
SpaceBeforeAssignmentOperators: true
141+
SpaceBeforeCaseColon: false
142+
SpaceBeforeCpp11BracedList: false
143+
SpaceBeforeCtorInitializerColon: true
144+
SpaceBeforeInheritanceColon: true
145+
SpaceBeforeParens: ControlStatements
146+
SpaceAroundPointerQualifiers: Default
147+
SpaceBeforeRangeBasedForLoopColon: true
148+
SpaceInEmptyBlock: false
149+
SpaceInEmptyParentheses: false
150+
SpacesBeforeTrailingComments: 1
151+
SpacesInAngles: Never
152+
SpacesInConditionalStatement: false
153+
SpacesInContainerLiterals: true
154+
SpacesInCStyleCastParentheses: false
155+
SpacesInLineCommentPrefix:
156+
Minimum: 1
157+
Maximum: -1
158+
SpacesInParentheses: false
159+
SpacesInSquareBrackets: false
160+
SpaceBeforeSquareBrackets: false
161+
BitFieldColonSpacing: Both
162+
Standard: Latest
163+
StatementAttributeLikeMacros:
164+
- Q_EMIT
165+
StatementMacros:
166+
- Q_UNUSED
167+
- QT_REQUIRE_VERSION
168+
TabWidth: 8
169+
UseCRLF: false
170+
UseTab: Never
171+
WhitespaceSensitiveMacros:
172+
- STRINGIZE
173+
- PP_STRINGIZE
174+
- BOOST_PP_STRINGIZE
175+
- NS_SWIFT_NAME
176+
- CF_SWIFT_NAME
177+
...
178+

.clang_format.hook

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
readonly VERSION="3.8"
5+
6+
version=$(clang-format -version)
7+
8+
if ! [[ version=="VERSION"* ]]; then
9+
echo "clang-format version check failed."
10+
echo "a version contains 'VERSION′isneeded,butget′version'"
11+
echo "you can install the right version, and make an soft-link to '$PATH' env"
12+
exit -1
13+
fi
14+
15+
clang-format -style=google $@

.cpplint_pre_commit.hook

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
#TOTAL_ERRORS=0
4+
#echo "HAHAHAHAHHA"
5+
#exit 5
6+
#
7+
#files=$(
8+
#
9+
#if [[ ! $TRAVIS_BRANCH ]]; then
10+
# # install cpplint on local machine.
11+
# if [[ ! $(which cpplint) ]]; then
12+
# pip install cpplint
13+
# fi
14+
# # diff files on local machine.
15+
# files=$(git diff --cached --name-status | awk 'Extra open brace or missing close brace2}')
16+
#else
17+
# # diff files between PR and latest commit on Travis CI.
18+
# branch_ref=(gitrev−parse"TRAVIS_BRANCH")
19+
# head_ref=$(git rev-parse HEAD)
20+
# files=(gitdiff−−name−statusbranch_ref $head_ref | awk 'Extra open brace or missing close brace2}')
21+
#fi
22+
## The trick to remove deleted files: https://stackoverflow.com/a/2413151
23+
#for file in $files; do
24+
# echo $file
25+
# if [[ $file =~ ^(patches/.*) ]]; then
26+
# continue;
27+
# else
28+
# cpplint --filter=-readability/fn_size $file;
29+
# TOTAL_ERRORS=(exprTOTAL_ERRORS + $?);
30+
# fi
31+
#done
32+
#
33+
#exit $TOTAL_ERRORS
34+
35+
if git rev-parse --verify HEAD >/dev/null 2>&1
36+
then
37+
against=HEAD
38+
else
39+
# Initial commit: diff against an empty tree object
40+
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
41+
fi
42+
43+
# Redirect output to stderr.
44+
exec 1>&2
45+
46+
cpplint=cpplint
47+
sum=0
48+
filters='-build/include_order,-build/namespaces,-legal/copyright,-runtime/references,-build/include_what_you_use'
49+
50+
# for cpp
51+
for file in $(git diff-index --name-status $against -- | grep -E '\.[ch](pp)?$' | awk '{print $2}'); do
52+
$cpplint --filter=$filters $file
53+
sum=$(expr ${sum} + $?)
54+
done
55+
56+
if [ ${sum} -eq 0 ]; then
57+
exit 0
58+
else
59+
exit 1
60+
fi

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fastdeploy/libs/lib*

.pre-commit-config.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
repos:
2+
- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
3+
rev: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
4+
hooks:
5+
- id: yapf
6+
files: \.py$
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: a11d9314b22d8f8c7556443875b731ef05965464
9+
hooks:
10+
- id: check-merge-conflict
11+
- id: check-symlinks
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- id: detect-private-key
15+
- id: check-symlinks
16+
- id: check-added-large-files
17+
- repo: local
18+
19+
hooks:
20+
- id: copyright_checker
21+
name: copyright_checker
22+
entry: python ./.copyright.hook
23+
language: system
24+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
25+
exclude: (?!.*third_party)^.*$
26+
27+
- repo: local
28+
hooks:
29+
- id: clang-format-with-version-check
30+
name: clang-format
31+
description: Format files with ClangFormat.
32+
entry: bash .clang_format.hook -i
33+
language: system
34+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$
35+
36+
- repo: local
37+
hooks:
38+
- id: cpplint-cpp-source
39+
name: cpplint
40+
description: Check C++ code style using cpplint.py.
41+
entry: bash .cpplint_pre_commit.hook
42+
language: system
43+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$

0 commit comments

Comments
 (0)