Skip to content

Commit 3a8cc5c

Browse files
NJrslvtuhaihe
authored andcommitted
[gp_stats_collector] Code quality cleanup
Delete stale .gitignore. Add Apache headers to .proto files. Change #pragma once to #ifndef guards. Remove test result files from tree. Change ereport(FATAL) to ereport(ERROR). Remove internal naming suffixes. Apply clang-format from gporca.
1 parent 7e12a93 commit 3a8cc5c

39 files changed

Lines changed: 2774 additions & 2902 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ lib*.pc
7373
/compile_commands.json
7474
/tmp_install/
7575
/.cache/
76-
/install/
76+
/install/
Lines changed: 178 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,178 @@
1-
BasedOnStyle: LLVM
2-
SortIncludes: false
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveMacros: false
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveBitFields: false
8+
AlignConsecutiveDeclarations: false
9+
AlignEscapedNewlines: Left
10+
AlignOperands: Align
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: false
15+
AllowShortEnumsOnASingleLine: true
16+
AllowShortBlocksOnASingleLine: Never
17+
AllowShortCaseLabelsOnASingleLine: false
18+
AllowShortFunctionsOnASingleLine: None
19+
AllowShortLambdasOnASingleLine: All
20+
AllowShortIfStatementsOnASingleLine: Never
21+
AllowShortLoopsOnASingleLine: false
22+
AlwaysBreakAfterDefinitionReturnType: All
23+
AlwaysBreakAfterReturnType: AllDefinitions
24+
AlwaysBreakBeforeMultilineStrings: true
25+
AlwaysBreakTemplateDeclarations: Yes
26+
BinPackArguments: true
27+
BinPackParameters: true
28+
BraceWrapping:
29+
AfterCaseLabel: true
30+
AfterClass: true
31+
AfterControlStatement: Always
32+
AfterEnum: true
33+
AfterFunction: true
34+
AfterNamespace: true
35+
AfterObjCDeclaration: true
36+
AfterStruct: true
37+
AfterUnion: true
38+
AfterExternBlock: false
39+
BeforeCatch: true
40+
BeforeElse: true
41+
BeforeLambdaBody: false
42+
BeforeWhile: false
43+
IndentBraces: false
44+
SplitEmptyFunction: true
45+
SplitEmptyRecord: true
46+
SplitEmptyNamespace: true
47+
BreakBeforeBinaryOperators: None
48+
BreakBeforeBraces: Custom
49+
BreakBeforeInheritanceComma: false
50+
BreakInheritanceList: BeforeColon
51+
BreakBeforeTernaryOperators: true
52+
BreakConstructorInitializersBeforeComma: false
53+
BreakConstructorInitializers: BeforeColon
54+
BreakAfterJavaFieldAnnotations: false
55+
BreakStringLiterals: false
56+
ColumnLimit: 80
57+
CommentPragmas: '^ IWYU pragma:'
58+
CompactNamespaces: false
59+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
60+
ConstructorInitializerIndentWidth: 4
61+
ContinuationIndentWidth: 4
62+
Cpp11BracedListStyle: true
63+
DeriveLineEnding: true
64+
DerivePointerAlignment: false
65+
DisableFormat: false
66+
ExperimentalAutoDetectBinPacking: false
67+
FixNamespaceComments: true
68+
ForEachMacros:
69+
- foreach
70+
- Q_FOREACH
71+
- BOOST_FOREACH
72+
IncludeBlocks: Preserve
73+
IncludeCategories:
74+
- Regex: '^<.*'
75+
Priority: 1
76+
- Regex: '"protos/.*\.pb\.h"'
77+
Priority: 2
78+
- Regex: '"postgres\.h"'
79+
Priority: 3
80+
- Regex: '.*'
81+
Priority: 4
82+
IncludeIsMainRegex: '([-_](test|unittest))?$'
83+
IncludeIsMainSourceRegex: ''
84+
IndentCaseLabels: true
85+
IndentCaseBlocks: false
86+
IndentGotoLabels: true
87+
IndentPPDirectives: None
88+
IndentExternBlock: AfterExternBlock
89+
IndentWidth: 4
90+
IndentWrappedFunctionNames: false
91+
InsertTrailingCommas: None
92+
JavaScriptQuotes: Leave
93+
JavaScriptWrapImports: true
94+
KeepEmptyLinesAtTheStartOfBlocks: false
95+
MacroBlockBegin: ''
96+
MacroBlockEnd: ''
97+
MaxEmptyLinesToKeep: 3
98+
NamespaceIndentation: None
99+
ObjCBinPackProtocolList: Never
100+
ObjCBlockIndentWidth: 2
101+
ObjCBreakBeforeNestedBlockParam: true
102+
ObjCSpaceAfterProperty: false
103+
ObjCSpaceBeforeProtocolList: true
104+
PenaltyBreakAssignment: 2
105+
PenaltyBreakBeforeFirstCallParameter: 1
106+
PenaltyBreakComment: 300
107+
PenaltyBreakFirstLessLess: 120
108+
PenaltyBreakString: 1000
109+
PenaltyBreakTemplateDeclaration: 10
110+
PenaltyExcessCharacter: 1000000
111+
PenaltyReturnTypeOnItsOwnLine: 200
112+
PointerAlignment: Right
113+
RawStringFormats:
114+
- Language: Cpp
115+
Delimiters:
116+
- cc
117+
- CC
118+
- cpp
119+
- Cpp
120+
- CPP
121+
- 'c++'
122+
- 'C++'
123+
CanonicalDelimiter: ''
124+
BasedOnStyle: google
125+
- Language: TextProto
126+
Delimiters:
127+
- pb
128+
- PB
129+
- proto
130+
- PROTO
131+
EnclosingFunctions:
132+
- EqualsProto
133+
- EquivToProto
134+
- PARSE_PARTIAL_TEXT_PROTO
135+
- PARSE_TEST_PROTO
136+
- PARSE_TEXT_PROTO
137+
- ParseTextOrDie
138+
- ParseTextProtoOrDie
139+
- ParseTestProto
140+
- ParsePartialTestProto
141+
CanonicalDelimiter: ''
142+
BasedOnStyle: google
143+
ReflowComments: false
144+
SortIncludes: true
145+
SortUsingDeclarations: true
146+
SpaceAfterCStyleCast: true
147+
SpaceAfterLogicalNot: false
148+
SpaceAfterTemplateKeyword: true
149+
SpaceBeforeAssignmentOperators: true
150+
SpaceBeforeCpp11BracedList: false
151+
SpaceBeforeCtorInitializerColon: true
152+
SpaceBeforeInheritanceColon: true
153+
SpaceBeforeParens: ControlStatements
154+
SpaceBeforeRangeBasedForLoopColon: true
155+
SpaceInEmptyBlock: false
156+
SpaceInEmptyParentheses: false
157+
SpacesBeforeTrailingComments: 2
158+
SpacesInAngles: false
159+
SpacesInConditionalStatement: false
160+
SpacesInContainerLiterals: true
161+
SpacesInCStyleCastParentheses: false
162+
SpacesInParentheses: false
163+
SpacesInSquareBrackets: false
164+
SpaceBeforeSquareBrackets: false
165+
Standard: Auto
166+
StatementMacros:
167+
- Q_UNUSED
168+
- QT_REQUIRE_VERSION
169+
TabWidth: 4
170+
UseCRLF: false
171+
UseTab: Always
172+
WhitespaceSensitiveMacros:
173+
- STRINGIZE
174+
- PP_STRINGIZE
175+
- BOOST_PP_STRINGIZE
176+
...
177+
178+

gpcontrib/gp_stats_collector/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

gpcontrib/gp_stats_collector/protos/gpsc_metrics.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
syntax = "proto3";
220

321
package gpsc;

gpcontrib/gp_stats_collector/protos/gpsc_plan.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
syntax = "proto3";
220

321
package gpsc;

gpcontrib/gp_stats_collector/protos/gpsc_set_service.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
119
syntax = "proto3";
220

321
import "google/protobuf/timestamp.proto";

0 commit comments

Comments
 (0)