Skip to content

Commit 0a7ed17

Browse files
authored
Migrate pre-commit to prek (rust based) (#1887)
1 parent 26f96b1 commit 0a7ed17

File tree

5 files changed

+27
-92
lines changed

5 files changed

+27
-92
lines changed

.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
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install the project
3030
run: uv sync --all-extras --dev
3131

32-
- name: Run pre-commit
32+
- name: Run prek (pre-commit checks)
3333
env:
3434
SKIP: ${{ github.ref == 'refs/heads/main' && 'no-commit-to-branch' || '' }}
35-
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
35+
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
@@ -31,11 +31,11 @@ dev = [
3131
"tox<5.0.0,>=4.17.1",
3232
"pytest>=8.3.2,<10.0.0",
3333
"pytest-cov>=5,<8",
34-
"pre-commit<5.0,>=3.8",
3534
"pytest-asyncio>=0.23.8,<1.4.0",
3635
"ruff>=0.12.0",
3736
"mypy>=1.16.1",
3837
"ty>=0.0.8",
38+
"prek>=0.2.27",
3939
]
4040

4141
[tool.ruff.lint]

0 commit comments

Comments
 (0)