Skip to content

Commit 8409c64

Browse files
committed
ci: add clang-tidy Checks
Signed-off-by: Junwang Zhao <[email protected]>
1 parent f17fd2f commit 8409c64

File tree

11 files changed

+73
-13
lines changed

11 files changed

+73
-13
lines changed

.clang-tidy

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
---
18+
Checks: |
19+
-*,
20+
clang-diagnostic-*,
21+
clang-analyzer-*,
22+
google-*,
23+
modernize-*,
24+
-modernize-use-nodiscard,
25+
-modernize-use-trailing-return-type,
26+
readability-identifier-naming,
27+
28+
CheckOptions:
29+
- key: readability-identifier-naming.ParameterCase
30+
value: camelBack
31+
- key: readability-identifier-naming.ClassCase
32+
value: CamelCase
33+
- key: readability-identifier-naming.ClassMethodCase
34+
value: CamelCase
35+
- key: readability-identifier-naming.FunctionCase
36+
value: CamelCase
37+
- key: readability-identifier-naming.EnumConstantCase
38+
value: CamelCase
39+
- key: readability-identifier-naming.StaticConstantCase
40+
value: CamelCase
41+
- key: readability-identifier-naming.ScopedEnumConstantCase
42+
value: CamelCase
43+
- key: readability-identifier-naming.ConstexprVariableCase
44+
value: CamelCase
45+
- key: readability-identifier-naming.ClassConstantCase
46+
value: CamelCase
47+
- key: readability-identifier-naming.MemberCase
48+
value: lower_case
49+
- key: readability-identifier-naming.MemberSuffix
50+
value: '_'
51+
- key: readability-identifier-naming.VariableCase
52+
value: lower_case
53+
- key: readability-identifier-naming.VariableSuffix
54+
value: ''
55+
- key: readability-identifier-naming.ConstantPointerParameterCase
56+
value: lower_case
57+
- key: readability-identifier-naming.LocalConstantPointerCase
58+
value: lower_case
59+
60+
HeaderFilterRegex: '(src|test|example)'

example/demo_example.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "iceberg/puffin/demo_puffin.h"
2525

2626
int main() {
27-
std::cout << iceberg::DemoTable().print() << std::endl;
28-
std::cout << iceberg::puffin::DemoPuffin().print() << std::endl;
29-
std::cout << iceberg::arrow::DemoArrow().print() << std::endl;
27+
std::cout << iceberg::DemoTable().Print() << std::endl;
28+
std::cout << iceberg::puffin::DemoPuffin().Print() << std::endl;
29+
std::cout << iceberg::arrow::DemoArrow().Print() << std::endl;
3030
return 0;
3131
}

src/iceberg/arrow/demo_arrow.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
namespace iceberg::arrow {
2727

28-
std::string DemoArrow::print() const {
29-
return DemoTable().print() +
28+
std::string DemoArrow::Print() const {
29+
return DemoTable().Print() +
3030
", Arrow version: " + ::arrow::GetBuildInfo().version_string;
3131
}
3232

src/iceberg/arrow/demo_arrow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ICEBERG_ARROW_EXPORT DemoArrow : public Table {
3030
public:
3131
DemoArrow() = default;
3232
~DemoArrow() override = default;
33-
std::string print() const override;
33+
std::string Print() const override;
3434
};
3535

3636
} // namespace iceberg::arrow

src/iceberg/demo_table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323

2424
namespace iceberg {
2525

26-
std::string DemoTable::print() const { return "DemoTable"; }
26+
std::string DemoTable::Print() const { return "DemoTable"; }
2727

2828
} // namespace iceberg

src/iceberg/demo_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ICEBERG_EXPORT DemoTable : public Table {
2828
DemoTable() = default;
2929
~DemoTable() override = default;
3030

31-
std::string print() const override;
31+
std::string Print() const override;
3232
};
3333

3434
} // namespace iceberg

src/iceberg/puffin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace iceberg {
2828
class ICEBERG_EXPORT Puffin {
2929
public:
3030
virtual ~Puffin() = default;
31-
virtual std::string print() const = 0;
31+
virtual std::string Print() const = 0;
3232
};
3333

3434
} // namespace iceberg

src/iceberg/puffin/demo_puffin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
namespace iceberg::puffin {
2323

24-
std::string DemoPuffin::print() const { return "DemoPuffin"; }
24+
std::string DemoPuffin::Print() const { return "DemoPuffin"; }
2525

2626
} // namespace iceberg::puffin

src/iceberg/puffin/demo_puffin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ICEBERG_PUFFIN_EXPORT DemoPuffin : public Puffin {
2828
public:
2929
DemoPuffin() = default;
3030
~DemoPuffin() override = default;
31-
std::string print() const override;
31+
std::string Print() const override;
3232
};
3333

3434
} // namespace iceberg::puffin

src/iceberg/table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace iceberg {
2929
class ICEBERG_EXPORT Table {
3030
public:
3131
virtual ~Table() = default;
32-
virtual std::string print() const = 0;
32+
virtual std::string Print() const = 0;
3333
};
3434

3535
} // namespace iceberg

0 commit comments

Comments
 (0)