Skip to content

Commit 5a3564d

Browse files
committed
Add GitHub cpp-linter-action
1 parent 9f99f85 commit 5a3564d

File tree

4 files changed

+69
-13
lines changed

4 files changed

+69
-13
lines changed

.github/workflows/cpp-linter.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
name: pre-commit
19+
20+
on:
21+
pull_request:
22+
push:
23+
branches:
24+
- '**'
25+
- '!dependabot/**'
26+
27+
jobs:
28+
pre-commit:
29+
runs-on: ubuntu-24.04
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-python@v5
33+
- uses: pre-commit/action@v3.0.1

.github/workflows/license_check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
name: "Run License Check"
19+
1920
on: pull_request
2021

2122
jobs:

.github/workflows/pre-commit.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,37 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
name: pre-commit
18+
name: C++ Linter
1919

2020
on:
2121
pull_request:
22-
push:
22+
paths-ignore:
23+
- '.github/**'
24+
- 'ci/**'
25+
- 'cmake_modules/**'
2326
branches:
24-
- '**'
25-
- '!dependabot/**'
27+
- main
2628

2729
jobs:
28-
pre-commit:
30+
cpp-linter:
2931
runs-on: ubuntu-24.04
3032
steps:
31-
- uses: actions/checkout@v4
32-
- uses: actions/setup-python@v5
33-
- uses: pre-commit/action@v3.0.1
33+
- uses: actions/checkout@v4
34+
- uses: cpp-linter/cpp-linter-action@v2.13.3
35+
id: linter
36+
continue-on-error: true
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
style: file
41+
tidy-checks: file
42+
files-changed-only: true
43+
lines-changed-only: true
44+
thread-comments: true
45+
ignore: 'build|cmake_modules|ci'
46+
database: build/compile_commands.json
47+
- name: Fail fast?!
48+
if: steps.linter.outputs.checks-failed != 0
49+
run: |
50+
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
51+
exit 1

api/iceberg/table.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@
2020
#pragma once
2121

2222
#include <memory>
23-
#include <string_view>
23+
#include <string_view>
2424

2525
namespace iceberg {
2626

2727
class Table {
28-
public:
29-
virtual ~Table() = default;
30-
virtual std::string_view print() const = 0;
28+
public:
29+
30+
virtual ~Table( ) = default;
31+
virtual std::string_view print()
32+
33+
const = 0;
3134
static std::unique_ptr<Table> create();
32-
};
35+
36+
} ;
3337

3438
} // namespace iceberg

0 commit comments

Comments
 (0)