Skip to content

Commit fccea0e

Browse files
committed
Add pre-commit config
Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
1 parent b5c3d45 commit fccea0e

File tree

11 files changed

+84
-16
lines changed

11 files changed

+84
-16
lines changed

.asf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ notifications:
4545
commits: commits@iceberg.apache.org
4646
issues: issues@iceberg.apache.org
4747
pullrequests: issues@iceberg.apache.org
48-
jira_options: link label link label
48+
jira_options: link label link label

.github/.licenserc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ header:
1212
- 'LICENSE'
1313
- 'NOTICE'
1414

15-
comment: on-failure
15+
comment: on-failure

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ updates:
2323
schedule:
2424
interval: "daily"
2525
open-pull-requests-limit: 10
26-

.github/workflows/pre-commit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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: [main]
24+
25+
jobs:
26+
pre-commit:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-python@v3
31+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
# To use this, install the python package `pre-commit` and
19+
# run once `pre-commit install`. This will setup a git pre-commit-hook
20+
# that is executed on each commit and will report the linting problems.
21+
# To run all hooks on all files use `pre-commit run -a`
22+
23+
repos:
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v5.0.0
26+
hooks:
27+
- id: trailing-whitespace
28+
- id: end-of-file-fixer
29+
- id: check-yaml
30+
- id: check-added-large-files
31+
32+
- repo: https://github.com/pre-commit/mirrors-clang-format
33+
rev: v19.1.5
34+
hooks:
35+
- id: clang-format
36+
37+
- repo: https://github.com/cheshirekow/cmake-format-precommit
38+
rev: v0.6.10
39+
hooks:
40+
- id: cmake-format

api/iceberg/puffin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
namespace iceberg {
2626

2727
class Puffin {
28-
public:
28+
public:
2929
virtual ~Puffin() = default;
3030
virtual std::string_view print() const = 0;
3131
static std::unique_ptr<Puffin> create();
3232
};
3333

34-
} // namespace iceberg
34+
} // namespace iceberg

api/iceberg/table.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
namespace iceberg {
2626

2727
class Table {
28-
public:
28+
public:
2929
virtual ~Table() = default;
3030
virtual std::string_view print() const = 0;
3131
static std::unique_ptr<Table> create();
3232
};
3333

34-
} // namespace iceberg
34+
} // namespace iceberg

src/core/demo_table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ std::string_view DemoTable::print() const { return "DemoTable"; }
2525

2626
std::unique_ptr<Table> Table::create() { return std::make_unique<DemoTable>(); }
2727

28-
} // namespace iceberg
28+
} // namespace iceberg

src/core/demo_table.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
namespace iceberg {
2525

2626
class DemoTable : public Table {
27-
public:
27+
public:
2828
DemoTable() = default;
2929
~DemoTable() override = default;
3030

3131
std::string_view print() const override;
3232
};
3333

34-
} // namespace iceberg
34+
} // namespace iceberg

src/puffin/demo_puffin.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ namespace iceberg {
2323

2424
std::string_view DemoPuffin::print() const { return "DemoPuffin"; }
2525

26-
std::unique_ptr<Puffin> Puffin::create() {
27-
return std::make_unique<DemoPuffin>();
28-
}
26+
std::unique_ptr<Puffin> Puffin::create() { return std::make_unique<DemoPuffin>(); }
2927

30-
} // namespace iceberg
28+
} // namespace iceberg

0 commit comments

Comments
 (0)