Skip to content

Commit b96e73f

Browse files
committed
first commit
0 parents  commit b96e73f

File tree

26,212 files changed

+2941535
-0
lines changed

Some content is hidden

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

26,212 files changed

+2941535
-0
lines changed

.clang-format

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
BasedOnStyle: WebKit
2+
Language: Cpp
3+
AlignAfterOpenBracket: AlwaysBreak
4+
BreakBeforeBraces: Custom
5+
BraceWrapping:
6+
AfterClass: true
7+
AfterControlStatement: true
8+
AfterEnum: true
9+
AfterFunction: true
10+
AfterNamespace: true
11+
AfterStruct: true
12+
AfterUnion: true
13+
BeforeCatch: true
14+
BeforeElse: true
15+
BeforeLambdaBody: true
16+
IndentBraces: false
17+
BreakConstructorInitializersBeforeComma: false
18+
Cpp11BracedListStyle: true
19+
ColumnLimit: 140
20+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
21+
ExperimentalAutoDetectBinPacking: true
22+
UseTab: Never
23+
TabWidth: 4
24+
Standard: Cpp11
25+
PointerAlignment: Middle
26+
MaxEmptyLinesToKeep: 2
27+
KeepEmptyLinesAtTheStartOfBlocks: false
28+
AllowShortFunctionsOnASingleLine: InlineOnly
29+
AlwaysBreakTemplateDeclarations: true
30+
IndentCaseLabels: true
31+
SpaceAfterTemplateKeyword: true
32+
SpaceBeforeCpp11BracedList: false
33+
SortIncludes: true
34+
IndentPPDirectives: AfterHash
35+
IncludeCategories:
36+
- Regex: '^<[a-z_]+>'
37+
Priority: 1
38+
- Regex: '^<[a-z_]+.h>'
39+
Priority: 2
40+
- Regex: '^["<](common|ext|mysqlxx|daemon|zkutil)/'
41+
Priority: 90
42+
- Regex: '^["<](DB)/'
43+
Priority: 100
44+
- Regex: '^["<](Poco)/'
45+
Priority: 50
46+
- Regex: '^"'
47+
Priority: 110
48+
- Regex: '/'
49+
Priority: 30
50+
- Regex: '.*'
51+
Priority: 40
52+
ReflowComments: false
53+
AlignEscapedNewlinesLeft: false
54+
AlignEscapedNewlines: DontAlign
55+
AlignTrailingComments: false
56+
57+
# Not changed:
58+
AccessModifierOffset: -4
59+
AlignConsecutiveAssignments: false
60+
AlignOperands: false
61+
AllowAllParametersOfDeclarationOnNextLine: true
62+
AllowShortBlocksOnASingleLine: false
63+
AllowShortCaseLabelsOnASingleLine: false
64+
AllowShortIfStatementsOnASingleLine: false
65+
AllowShortLoopsOnASingleLine: false
66+
AlwaysBreakAfterDefinitionReturnType: None
67+
AlwaysBreakBeforeMultilineStrings: false
68+
BinPackArguments: false
69+
BinPackParameters: false
70+
BreakBeforeBinaryOperators: All
71+
BreakBeforeTernaryOperators: true
72+
CommentPragmas: '^ IWYU pragma:'
73+
ConstructorInitializerIndentWidth: 4
74+
ContinuationIndentWidth: 4
75+
DerivePointerAlignment: false
76+
DisableFormat: false
77+
IndentRequiresClause: false
78+
IndentWidth: 4
79+
IndentWrappedFunctionNames: false
80+
MacroBlockBegin: ''
81+
MacroBlockEnd: ''
82+
NamespaceIndentation: None
83+
ObjCBlockIndentWidth: 4
84+
ObjCSpaceAfterProperty: true
85+
ObjCSpaceBeforeProtocolList: true
86+
PenaltyBreakBeforeFirstCallParameter: 19
87+
PenaltyBreakComment: 300
88+
PenaltyBreakFirstLessLess: 120
89+
PenaltyBreakString: 1000
90+
PenaltyExcessCharacter: 1000000
91+
PenaltyReturnTypeOnItsOwnLine: 60
92+
RemoveBracesLLVM: true
93+
SpaceAfterCStyleCast: false
94+
SpaceBeforeAssignmentOperators: true
95+
SpaceBeforeParens: ControlStatements
96+
SpaceInEmptyParentheses: false
97+
SpacesBeforeTrailingComments: 1
98+
SpacesInContainerLiterals: true
99+
SpacesInCStyleCastParentheses: false
100+
SpacesInParentheses: false
101+
SpacesInSquareBrackets: false

.clang-tidy

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# To run clang-tidy from CMake, build ClickHouse with -DENABLE_CLANG_TIDY=1. To show all warnings, it is
2+
# recommended to pass "-k0" to Ninja.
3+
4+
# Enable all checks + disable selected checks. Feel free to remove disabled checks from below list if
5+
# a) the new check is not controversial (this includes many checks in readability-* and google-*) or
6+
# b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*).
7+
8+
# TODO: Once clang(-tidy) 17 is the minimum, we can convert this list to YAML
9+
# See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/ReleaseNotes.html#improvements-to-clang-tidy
10+
11+
# TODO Let clang-tidy check headers in further directories
12+
# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$'
13+
HeaderFilterRegex: '^.*/(base)/.*(h|hpp)$'
14+
15+
Checks: '*,
16+
-abseil-*,
17+
18+
-altera-*,
19+
20+
-android-*,
21+
22+
-bugprone-assignment-in-if-condition,
23+
-bugprone-branch-clone,
24+
-bugprone-easily-swappable-parameters,
25+
-bugprone-exception-escape,
26+
-bugprone-implicit-widening-of-multiplication-result,
27+
-bugprone-narrowing-conversions,
28+
-bugprone-not-null-terminated-result,
29+
-bugprone-reserved-identifier, # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
30+
-bugprone-unchecked-optional-access,
31+
32+
-cert-dcl16-c,
33+
-cert-dcl37-c,
34+
-cert-dcl51-cpp,
35+
-cert-err58-cpp,
36+
-cert-msc32-c,
37+
-cert-msc51-cpp,
38+
-cert-oop54-cpp,
39+
-cert-oop57-cpp,
40+
41+
-clang-analyzer-unix.Malloc,
42+
43+
-cppcoreguidelines-*, # impractical in a codebase as large as ClickHouse, also slow
44+
45+
-darwin-*,
46+
47+
-fuchsia-*,
48+
49+
-google-build-using-namespace,
50+
-google-readability-braces-around-statements,
51+
-google-readability-casting,
52+
-google-readability-function-size,
53+
-google-readability-namespace-comments,
54+
-google-readability-todo,
55+
56+
-hicpp-avoid-c-arrays,
57+
-hicpp-avoid-goto,
58+
-hicpp-braces-around-statements,
59+
-hicpp-explicit-conversions,
60+
-hicpp-function-size,
61+
-hicpp-member-init,
62+
-hicpp-move-const-arg,
63+
-hicpp-multiway-paths-covered,
64+
-hicpp-named-parameter,
65+
-hicpp-no-array-decay,
66+
-hicpp-no-assembler,
67+
-hicpp-no-malloc,
68+
-hicpp-signed-bitwise,
69+
-hicpp-special-member-functions,
70+
-hicpp-uppercase-literal-suffix,
71+
-hicpp-use-auto,
72+
-hicpp-use-emplace,
73+
-hicpp-vararg,
74+
75+
-linuxkernel-*,
76+
77+
-llvm-*,
78+
79+
-llvmlibc-*,
80+
81+
-openmp-*,
82+
83+
-misc-const-correctness,
84+
-misc-include-cleaner, # useful but far too many occurrences
85+
-misc-no-recursion,
86+
-misc-non-private-member-variables-in-classes,
87+
-misc-confusable-identifiers, # useful but slooow
88+
-misc-use-anonymous-namespace,
89+
90+
-modernize-avoid-c-arrays,
91+
-modernize-concat-nested-namespaces,
92+
-modernize-macro-to-enum,
93+
-modernize-pass-by-value,
94+
-modernize-return-braced-init-list,
95+
-modernize-use-auto,
96+
-modernize-use-default-member-init,
97+
-modernize-use-emplace,
98+
-modernize-use-nodiscard,
99+
-modernize-use-override,
100+
-modernize-use-trailing-return-type,
101+
102+
-performance-inefficient-string-concatenation,
103+
-performance-no-int-to-ptr,
104+
-performance-avoid-endl,
105+
-performance-unnecessary-value-param,
106+
107+
-portability-simd-intrinsics,
108+
109+
-readability-avoid-unconditional-preprocessor-if,
110+
-readability-braces-around-statements,
111+
-readability-convert-member-functions-to-static,
112+
-readability-else-after-return,
113+
-readability-function-cognitive-complexity,
114+
-readability-function-size,
115+
-readability-identifier-length,
116+
-readability-identifier-naming, # useful but too slow
117+
-readability-implicit-bool-conversion,
118+
-readability-isolate-declaration,
119+
-readability-magic-numbers,
120+
-readability-named-parameter,
121+
-readability-redundant-declaration,
122+
-readability-simplify-boolean-expr,
123+
-readability-static-accessed-through-instance,
124+
-readability-suspicious-call-argument,
125+
-readability-uppercase-literal-suffix,
126+
-readability-use-anyofallof,
127+
128+
-zircon-*,
129+
'
130+
131+
WarningsAsErrors: '*'
132+
133+
ExtraArgs:
134+
# clang-tidy 17 started to complain (for unknown reasons) that various pragmas are unknown ("clang-diagnostic-unknown-pragmas").
135+
# This is technically a compiler error, not a clang-tidy error. We could litter the code base with more pragmas that suppress
136+
# this error but it is better to pass the following flag to the compiler:
137+
- '-Wno-unknown-pragmas'
138+
- '-Wno-unused-command-line-argument' # similar issue
139+
140+
CheckOptions:
141+
readability-identifier-naming.ClassCase: CamelCase
142+
readability-identifier-naming.EnumCase: CamelCase
143+
readability-identifier-naming.LocalVariableCase: lower_case
144+
readability-identifier-naming.StaticConstantCase: aNy_CasE
145+
readability-identifier-naming.MemberCase: lower_case
146+
readability-identifier-naming.PrivateMemberPrefix: ''
147+
readability-identifier-naming.ProtectedMemberPrefix: ''
148+
readability-identifier-naming.PublicMemberCase: lower_case
149+
readability-identifier-naming.MethodCase: camelBack
150+
readability-identifier-naming.PrivateMethodPrefix: ''
151+
readability-identifier-naming.ProtectedMethodPrefix: ''
152+
readability-identifier-naming.ParameterPackCase: lower_case
153+
readability-identifier-naming.StructCase: CamelCase
154+
readability-identifier-naming.TemplateTemplateParameterCase: CamelCase
155+
readability-identifier-naming.TemplateParameterCase: lower_case
156+
readability-identifier-naming.TypeTemplateParameterCase: CamelCase
157+
readability-identifier-naming.TypedefCase: CamelCase
158+
readability-identifier-naming.UnionCase: CamelCase
159+
modernize-loop-convert.UseCxx20ReverseRanges: false
160+
performance-move-const-arg.CheckTriviallyCopyableMove: false
161+
# Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097
162+
readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type
163+
cppcoreguidelines-avoid-do-while.IgnoreMacros: true

.clangd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Diagnostics:
2+
# clangd does parse .clang-tidy, but some checks are too slow to run in
3+
# clang-tidy build, so let's enable them explicitly for clangd at least.
4+
ClangTidy:
5+
# The following checks had been disabled due to slowliness with C++23,
6+
# for more details see [1].
7+
#
8+
# [1]: https://github.com/llvm/llvm-project/issues/61418
9+
#
10+
# But the code base had been written in a style that had been checked
11+
# by this check, so at least, let's enable it for clangd.
12+
Add: [
13+
# configured in .clang-tidy
14+
readability-identifier-naming,
15+
bugprone-reserved-identifier,
16+
]

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
9+
# Matches multiple files with brace expansion notation
10+
# Set default charset
11+
[*.{c,cpp,cxx,h,hpp,hxx,py,cmake}]
12+
charset = utf-8
13+
indent_style = space
14+
indent_size = 4
15+
trim_trailing_whitespace = true
16+
17+
[CMakeLists.txt]
18+
charset = utf-8
19+
indent_style = space
20+
indent_size = 4
21+
trim_trailing_whitespace = true

.exrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
au BufRead,BufNewFile * set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab tags=tags,../tags

.git-blame-ignore-revs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This is a file that can be used by git-blame to ignore some revisions.
2+
# (git 2.23+, released in August 2019)
3+
#
4+
# Can be configured as follow:
5+
#
6+
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
7+
#
8+
# For more information you can look at git-blame(1) man page.
9+
10+
# Changed tabs to spaces in code [#CLICKHOUSE-3]
11+
137ad95929ee016cc6d3c03bccb5586941c163ff
12+
13+
# dbms/ → src/
14+
# (though it is unlikely that you will see it in blame)
15+
06446b4f08a142d6f1bc30664c47ded88ab51782

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contrib/* linguist-vendored
2+
*.h linguist-language=C++
3+
tests/queries/0_stateless/data_json/* binary
4+
tests/queries/0_stateless/*.reference -crlf

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.github/ISSUE_TEMPLATE/10_question.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Question
3+
about: Ask a question about ClickHouse
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
> Make sure to check documentation https://clickhouse.com/docs/en/ first. If the question is concise and probably has a short answer, asking it in [community Slack](https://join.slack.com/t/clickhousedb/shared_invite/zt-1gh9ds7f4-PgDhJAaF8ad5RbWBAAjzFg) is probably the fastest way to find the answer. For more complicated questions, consider asking them on StackOverflow with "clickhouse" tag https://stackoverflow.com/questions/tagged/clickhouse
11+
12+
> If you still prefer GitHub issues, remove all this text and ask your question here.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for ClickHouse
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
> (you don't have to strictly follow this form)
11+
12+
**Use case**
13+
14+
> A clear and concise description of what is the intended usage scenario is.
15+
16+
**Describe the solution you'd like**
17+
18+
> A clear and concise description of what you want to happen.
19+
20+
**Describe alternatives you've considered**
21+
22+
> A clear and concise description of any alternative solutions or features you've considered.
23+
24+
**Additional context**
25+
26+
> Add any other context or screenshots about the feature request here.

0 commit comments

Comments
 (0)