Skip to content

Commit 64a3d57

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

File tree

11 files changed

+50
-13
lines changed

11 files changed

+50
-13
lines changed

.clang-tidy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
27+
CheckOptions:
28+
- key: google-readability-braces-around-statements.ShortStatementLines
29+
value: '1'
30+
- key: google-readability-function-size.StatementThreshold
31+
value: '800'
32+
- key: google-readability-namespace-comments.ShortNamespaceLines
33+
value: '10'
34+
- key: google-readability-namespace-comments.SpacesBeforeComments
35+
value: '2'
36+
37+
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)