Skip to content

perf: migrate from pre-commit to prek for performance improvement#142

Merged
Goldziher merged 13 commits intokreuzberg-dev:mainfrom
kh3rld:feat/migrate-pre-commit-to-prek
Sep 22, 2025
Merged

perf: migrate from pre-commit to prek for performance improvement#142
Goldziher merged 13 commits intokreuzberg-dev:mainfrom
kh3rld:feat/migrate-pre-commit-to-prek

Conversation

@kh3rld
Copy link
Copy Markdown
Contributor

@kh3rld kh3rld commented Sep 22, 2025

this PR migrates the project from pre-commit to prek, a faster, rust based drop-in replacement that provides significant performance improvements and enhanced developer experience

Changes Made

Core Migration

  • installed prek as replacement for pre-commit
  • removed pre-commit>=4.3.0 from pyproject.toml dev dependencies
  • updated Taskfile.yml commands (pre-commit to prek)
  • updated GitHub Actions workflow to install and use prek
  • updated documentation in docs/contributing.md
  • updated ai-rulez.yaml development guidelines

closes #141

- Add type ignore comment for torch assignment in _easyocr.py
- Update uv.lock to reflect dependency changes

These changes ensure all prek hooks pass successfully,
including mypy type checking.
- Update installation instructions to use prek
- Update command examples to use prek run
- Update notes section to reference prek

This completes the documentation migration to prek.
@kh3rld kh3rld changed the title migrate from pre-commit to prek for performance improvement perf: migrate from pre-commit to prek for performance improvement Sep 22, 2025
- Install prek and add to PATH
- Cache prek environments
- Run prek run --all-files instead of uv run pre-commit run

Fix missing pre-commit binary error in CI.
- Change condition from 'always()' to 'needs.test-pr.result == success'
- This prevents trying to download artifacts that were never uploaded
- Fixes 'Artifact not found' error when test-pr job fails
- Add condition 'secrets.DEEPSOURCE_DSN != ''' to both DeepSource upload steps
- This prevents workflow failure when the secret is not configured
- DeepSource upload will be skipped gracefully if secret is missing
- Add 'needs.test-pr.result == success' condition to DeepSource uploads
- This prevents DeepSource timeout when coverage artifacts are missing
- DeepSource will only run when tests actually pass and upload artifacts
Comment thread .github/workflows/ci.yaml Outdated
- Replace curl script with 'uv tool install prek' in CI workflow
- Update documentation to use uv installation method
- Update ai-rulez.yaml with uv installation step
- Ensures we always get the latest prek version automatically
@Goldziher Goldziher merged commit 94c6df2 into kreuzberg-dev:main Sep 22, 2025
3 of 4 checks passed
Goldziher added a commit that referenced this pull request Dec 10, 2025
perf: migrate from pre-commit to prek for performance improvement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from pre-commit to prek

2 participants