Skip to content

Commit 4ebf7d0

Browse files
committed
build: Migrate to prek
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
1 parent f0e4806 commit 4ebf7d0

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ on:
1515
- master
1616

1717
jobs:
18-
pre-commit:
19-
name: Generic pre-commit checks
18+
prek:
19+
name: Generic prek checks
2020
runs-on: ubuntu-22.04
2121
steps:
2222
- uses: actions/checkout@v4.2.2
@@ -27,8 +27,9 @@ jobs:
2727
with:
2828
python-version: 3.9
2929

30-
- run: pip install pre-commit
31-
- run: SKIP=mypy pre-commit run --all-files
30+
- uses: j178/prek-action@v1
31+
with:
32+
extra-args: --all-files --skip mypy
3233

3334
mypy:
3435
name: Mypy
@@ -42,8 +43,9 @@ jobs:
4243
with:
4344
python-version: 3.9
4445

45-
- run: pip install pre-commit
46-
- run: pre-commit run mypy --all-files
46+
- uses: j178/prek-action@v1
47+
with:
48+
extra-args: --all-files mypy
4749

4850
tests:
4951
strategy:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update pre-commit
1+
name: Update prek
22

33
on:
44
schedule:
@@ -11,25 +11,27 @@ permissions:
1111

1212
jobs:
1313
release:
14-
name: Update pre-commit
14+
name: Update prek
1515
runs-on: ubuntu-22.04
1616
steps:
1717
- uses: actions/checkout@v4.2.2
1818
with:
1919
fetch-depth: 1
2020
submodules: true
2121

22-
- run: pip install pre-commit
23-
- run: pre-commit autoupdate
22+
- uses: astral-sh/setup-uv@v7
23+
24+
- run: uv tool install prek
25+
- run: prek autoupdate
2426

2527
- name: Open pull request
2628
uses: peter-evans/create-pull-request@v7
2729
with:
2830
token: ${{ secrets.GITHUB_TOKEN }}
2931
delete-branch: true
30-
title: Update pre-commit
31-
body: Automatically update pre-commit
32-
commit-message: 'chore: Update pre-commit'
32+
title: Update prek
33+
body: Automatically update prek hooks
34+
commit-message: 'chore: Update prek'
3335
committer: 'Stranger6667 <dmitry@dygalo.dev>'
3436
author: 'Stranger6667 <dmitry@dygalo.dev>'
35-
branch: "create-pull-request/update-pre-commit"
37+
branch: "create-pull-request/update-prek"

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.9
2+
python: python3.10
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -32,11 +32,11 @@ repos:
3232
args: ["--ignore-missing-imports"]
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.14.13
35+
rev: v0.15.0
3636
hooks:
3737
- id: ruff-format
3838

3939
- repo: https://github.com/astral-sh/ruff-pre-commit
40-
rev: v0.14.13
40+
rev: v0.15.0
4141
hooks:
4242
- id: ruff

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the problem.
2323

2424
1. Fork the repository.
2525

26-
2. Enable and install [pre-commit](https://pre-commit.com) to ensure style-guides and code checks are followed.
26+
2. Enable and install [prek](https://prek.j178.dev) to ensure style-guides and code checks are followed.
2727

2828
3. Target the `master` branch.
2929

test/test_queries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def test(query):
415415
"inner_type_name": x["type_name"],
416416
"inner_default": x["default"],
417417
"outer_type_name": "InputData!",
418-
"outer_default": f'{{ inner: {x["default"]} }}',
418+
"outer_default": f"{{ inner: {x['default']} }}",
419419
},
420420
),
421421
)

0 commit comments

Comments
 (0)