Skip to content

Commit f7e3cda

Browse files
committed
Migrate pre-commit to prek (rust based) (#1887)
1 parent ef4c4c5 commit f7e3cda

5 files changed

Lines changed: 27 additions & 83 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1313
// "forwardPorts": [],
1414
// Use 'postCreateCommand' to run commands after the container is created.
15-
"postCreateCommand": "uv sync --all-extras --dev && uv run pre-commit install",
15+
"postCreateCommand": "uv sync --all-extras --dev && uv run prek install",
1616
// Configure tool-specific properties.
1717
"customizations": {
1818
"vscode": {

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install the project
3333
run: uv sync --all-extras --dev
3434

35-
- name: Run pre-commit
35+
- name: Run prek (pre-commit checks)
3636
env:
3737
SKIP: ${{ github.ref == 'refs/heads/main' && 'no-commit-to-branch' || '' }}
38-
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
38+
run: uv run prek run --show-diff-on-failure --color=always --all-files

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ Always use full type annotations, generics, and other modern practices.
2929
# Install all dependencies:
3030
uv sync
3131

32-
# Run linting (with ruff), pre-commit checks and type checking (with mypy).
32+
# Run linting (with ruff), prek (pre-commit alternative) checks and type checking (with mypy).
3333
# Note when you run this, ruff will auto-format and sort imports, resolving any
3434
# linter warnings about import ordering:
35-
uv run pre-commit run --all-files
35+
uv run prek run --all-files
3636

3737
# Run tests:
3838
uv run pytest

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ repository = "https://github.com/iMicknl/python-overkiz-api"
3030
dev = [
3131
"pytest>=8.3.2,<10.0.0",
3232
"pytest-cov>=5,<8",
33-
"pre-commit<5.0,>=3.8",
3433
"pytest-asyncio>=0.23.8,<1.4.0",
3534
"ruff>=0.12.0",
3635
"mypy>=1.16.1",
3736
"ty>=0.0.8",
37+
"prek>=0.2.27",
3838
]
3939

4040
[tool.ruff.lint]

0 commit comments

Comments
 (0)