Skip to content

Commit 178c224

Browse files
authored
feat: add a pre-commit hook (#178)
I'm adding a `pyproject.toml` because using `language: rust` does not work due to pre-commit/pre-commit#2931. This closes #177.
1 parent ce2bf70 commit 178c224

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2024 tison <wander4096@gmail.com>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
- id: hawkeye-format
16+
name: hawkeye-format
17+
description: "Run `hawkeye format` for license header formatting"
18+
entry: hawkeye format
19+
language: python
20+
args: []
21+
pass_filenames: false
22+
require_serial: true
23+
additional_dependencies: []
24+
minimum_pre_commit_version: "2.9.2"

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 tison <wander4096@gmail.com>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[build-system]
16+
requires = ["maturin>=1.0,<2.0"]
17+
build-backend = "maturin"
18+
19+
[tool.maturin]
20+
bindings = "bin"
21+
manifest-path = "cli/Cargo.toml"
22+

0 commit comments

Comments
 (0)