Skip to content

Commit 26ef73f

Browse files
authored
cicd: update precommit and run in CI (#48)
1 parent 8cd8bc7 commit 26ef73f

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.github/workflows/checks.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,23 @@ jobs:
4949
run: rustup component add rustfmt
5050

5151
- run: cargo fmt -- --check
52+
53+
precommit_hooks:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
cmd:
58+
- "end-of-file-fixer"
59+
- "trailing-whitespace"
60+
- "mixed-line-ending"
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Python 3.12
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: 3.12
68+
69+
- uses: pre-commit/[email protected]
70+
with:
71+
extra_args: ${{ matrix.cmd }} --all-files

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0 # pre-commit-hooks version
3+
rev: v5.0.0 # pre-commit-hooks version
44
hooks:
55
- id: check-added-large-files
66
- id: detect-private-key
@@ -9,6 +9,8 @@ repos:
99
- id: check-merge-conflict
1010
- id: detect-aws-credentials
1111
args: [ --allow-missing-credentials ]
12+
- id: mixed-line-ending
13+
args: [ --fix=lf ]
1214
- repo: https://github.com/astral-sh/ruff-pre-commit
1315
rev: v0.8.6 # ruff version
1416
hooks:
@@ -22,4 +24,4 @@ repos:
2224
entry: bash -c 'cd rust && cargo fmt'
2325
args: ['--verbose', '--']
2426

25-
minimum_pre_commit_version: 3.7.1
27+
minimum_pre_commit_version: 4.0.1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tests = [
3232
dev = [
3333
"maturin",
3434
"ruff==0.8.6",
35-
"pre-commit>=3.7.1",
35+
"pre-commit>=4.0.1",
3636
]
3737

3838
[project.urls]

0 commit comments

Comments
 (0)