Skip to content

chore: replace pre-commit with prek#168

Open
kmarchais wants to merge 1 commit intomainfrom
chore/replace-pre-commit-with-prek
Open

chore: replace pre-commit with prek#168
kmarchais wants to merge 1 commit intomainfrom
chore/replace-pre-commit-with-prek

Conversation

@kmarchais
Copy link
Owner

Summary

Replace pre-commit with prek, a faster Rust-native drop-in replacement.

Changes

  • Use prek builtin hooks for common checks (faster, no virtualenv needed)
  • Keep pre-commit-hooks repo for Python-specific checks without builtin equivalents
  • Update CI workflow to use j178/prek-action
  • Replace pre-commit dependency with prek in dev dependencies

Benefits

  • Single binary: No Python runtime needed for the tool itself
  • ~2× faster installs: Hook environments are shared between hooks
  • ~7× faster execution: Builtin hooks run natively in Rust
  • Fully compatible: Works with existing .pre-commit-config.yaml

Builtin hooks migrated

  • check-added-large-files, check-case-conflict, check-merge-conflict
  • check-toml, check-yaml, detect-private-key
  • end-of-file-fixer, fix-byte-order-marker, mixed-line-ending, trailing-whitespace

Hooks kept in pre-commit-hooks

  • check-ast, check-builtin-literals, check-docstring-first
  • check-illegal-windows-names, debug-statements, name-tests-test

Test plan

  • prek run --all-files passes locally
  • CI workflow runs successfully

prek is a faster, Rust-native drop-in replacement for pre-commit.

Changes:
- Use builtin hooks for common checks (trailing-whitespace, end-of-file-fixer, check-toml, check-yaml, etc.)
- Keep pre-commit-hooks repo for Python-specific checks (check-ast, debug-statements, etc.)
- Update CI workflow to use j178/prek-action
- Replace pre-commit dependency with prek in dev dependencies
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.49%. Comparing base (a636e1e) to head (381e043).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #168   +/-   ##
=======================================
  Coverage   88.49%   88.49%           
=======================================
  Files          22       22           
  Lines        2538     2538           
  Branches      429      429           
=======================================
  Hits         2246     2246           
  Misses        168      168           
  Partials      124      124           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

Benchmark Results Summary

Group Benchmarks Mean Time Range
autodetect-api 2 805.06ms - 816.35ms
autodetect-exe 2 868.32ms - 1607.32ms
comparison-2d 3 8.30ms - 772.35ms
comparison-3d 3 808.21ms - 1624.07ms
comparison-3d-wallclock 1 876.38ms - 876.38ms
comparison-surface 3 59.32ms - 823.33ms
duplicate-detection 3 5.79ms - 872.89ms
io-2d-read 1 3.83ms - 3.83ms
io-2d-write 1 6.16ms - 6.16ms
io-3d-read 1 40.28ms - 40.28ms
io-3d-write 1 2.94ms - 2.94ms
io-data-access 3 0.01ms - 0.16ms
io-pyvista-3d 2 1.06ms - 36.84ms
io-pyvista-surface 2 0.50ms - 14.26ms
io-surface-read 1 14.85ms - 14.85ms
io-surface-write 1 3.77ms - 3.77ms
mesh-construction-2d 3 0.24ms - 0.41ms
mesh-construction-3d 3 35.70ms - 36.00ms
mesh-construction-surface 3 8.38ms - 8.89ms
mesh-fields 2 0.00ms - 0.10ms
mesh-lowlevel-3d 2 35.73ms - 36.01ms
mesh-topology 3 0.00ms - 0.01ms
remesh-2d-baseline 3 0.76ms - 54.64ms
remesh-2d-modes 3 8.32ms - 9.20ms
remesh-2d-options 4 0.73ms - 8.30ms
remesh-2d-quality 2 0.04ms - 19.73ms
remesh-3d-baseline 3 305.70ms - 7704.66ms
remesh-3d-modes 3 336.98ms - 1002.52ms
remesh-3d-options 4 319.96ms - 839.52ms
remesh-3d-quality 2 0.09ms - 3.48ms
remesh-surface-baseline 3 39.38ms - 183.81ms
remesh-surface-modes 3 49.21ms - 60.98ms
remesh-surface-options 4 38.15ms - 62.46ms
remesh-surface-quality 2 0.05ms - 21.81ms

Total: 82 benchmarks

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.

1 participant