Skip to content

chore: migrate from pre-commit to prek#66

Merged
eifinger merged 6 commits intoeifinger:mainfrom
eifinger-bot:migrate-to-prek
Jan 31, 2026
Merged

chore: migrate from pre-commit to prek#66
eifinger merged 6 commits intoeifinger:mainfrom
eifinger-bot:migrate-to-prek

Conversation

@eifinger-bot
Copy link
Copy Markdown
Contributor

Summary

Replace pre-commit with prek, a faster Rust-based alternative.

Changes

  • Replace pre-commit and pre-commit-hooks with prek in pyproject.toml
  • Update CI workflow to cache prek instead of pre-commit
  • Update CI command from pre-commit to prek

Benefits

  • 🚀 Faster hook execution with Rust-native implementations
  • 📦 Single binary without Python runtime dependency
  • 🔄 Drop-in replacement, same hook IDs work

Reference

Same pattern as fressnapftracker PR #11

Replace pre-commit with prek, a faster Rust-based alternative.

Changes:
- Replace pre-commit and pre-commit-hooks with prek in pyproject.toml
- Update CI workflow to cache prek instead of pre-commit
- Update CI command from pre-commit to prek

Benefits:
- Faster hook execution with Rust-native implementations
- Single binary without Python runtime dependency
- Drop-in replacement, same hook IDs work
@eifinger eifinger added the github_actions Pull requests that update GitHub Actions code label Jan 31, 2026
Replace local hooks with builtin hooks that work with prek:
- Use repo: builtin instead of repo: local for standard hooks
- Update ruff-pre-commit to v0.9.4
- Update shellcheck to v0.10.0
- Remove prettier (not essential)
- Remove mypy and pytest from pre-commit (run in CI only)

This aligns with fressnapftracker configuration.
Remove hooks not supported by prek's builtin repo:
- check-ast
- check-docstring-first
- debug-statements

These hooks require the full pre-commit-hooks package.
Keep only hooks supported by prek's builtin implementation:
https://prek.j178.dev/builtin/
- Restore mypy as local hook (uses uv run mypy)
- Restore yamllint as local hook (uses uv run yamllint)
- Restore codespell exclude pattern for .lock and CHANGELOG.md
- Keep pytest in CI only (not in pre-commit, as it was slow)

Note: check-ast, check-docstring-first, debug-statements removed
as they require pre-commit-hooks package which we're replacing.
Add pytest as local hook (uses uv run pytest)
Keep ruff at original version (v0.1.7) to avoid introducing
new linting rules that would require code changes.

Also restore original hook names with emojis for consistency.
@eifinger eifinger merged commit 2dcf689 into eifinger:main Jan 31, 2026
4 checks passed
@eifinger eifinger added the chore No features, no bugfixes just stuff to keep it all running label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore No features, no bugfixes just stuff to keep it all running github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants