Skip to content

Commit d414c4d

Browse files
DarkaMaulclaude
andcommitted
Replace pre-commit with prek
Switch to prek (https://github.com/j178/prek), a faster Rust-based pre-commit alternative. Add built-in hooks for common checks: trailing-whitespace, end-of-file-fixer, check-yaml, check-toml, check-merge-conflict, and detect-private-key. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3726689 commit d414c4d

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

{{cookiecutter.project_slug}}/.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Pre-commit hooks for code quality
2-
# See https://pre-commit.com for more information
2+
# Uses prek (https://github.com/j178/prek) - a faster pre-commit alternative
33
repos:
4+
- repo: builtin
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-toml
10+
- id: check-merge-conflict
11+
- id: detect-private-key
12+
413
- repo: local
514
hooks:
615
- id: format
@@ -27,6 +36,5 @@ repos:
2736
require_serial: true
2837
stages: [pre-commit]
2938

30-
# Configuration
3139
ci:
3240
autofix_prs: true

{{cookiecutter.project_slug}}/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ all:
2424
.PHONY: dev
2525
dev:
2626
uv sync --group dev
27-
uv run pre-commit install
27+
uv run prek install
2828

2929
{%- if cookiecutter.entry_point %}
3030
.PHONY: run

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dev = [
4545
{include-group = "doc"},
4646
{include-group = "test"},
4747
{include-group = "lint"},
48-
"pre-commit",
48+
"prek",
4949
]
5050

5151
{% if cookiecutter.entry_point -%}

0 commit comments

Comments
 (0)