Skip to content

chore: Use prek instead of pre-commit#1391

Open
tpoliaw wants to merge 1 commit intomainfrom
prek-conversion
Open

chore: Use prek instead of pre-commit#1391
tpoliaw wants to merge 1 commit intomainfrom
prek-conversion

Conversation

@tpoliaw
Copy link
Contributor

@tpoliaw tpoliaw commented Feb 16, 2026

Trial run ahead of converting python-copier-template

@tpoliaw tpoliaw requested a review from a team as a code owner February 16, 2026 10:42
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (fe35430) to head (9d6d9fc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1391   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          43       43           
  Lines        2779     2779           
=======================================
  Hits         2641     2641           
  Misses        138      138           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tpoliaw tpoliaw changed the title Use prek instead of pre-commit chore: Use prek instead of pre-commit Feb 16, 2026
@ZohebShaikh
Copy link
Contributor

One of the reasoning mentioned in using per was that it is faster,
Can there be some profiling on how much faster it is ?

@tpoliaw
Copy link
Contributor Author

tpoliaw commented Feb 16, 2026

Their own benchmarks
Linked third party benchmarks

Running a similar test in blueapi

❯ hyperfine --prepare 'prek clean && pre-commit clean' 'prek install-hooks' 'pre-commit install-hooks'                                                                                                                                11:57:23
Benchmark 1: prek install-hooks
  Time (mean ± σ):      2.121 s ±  0.279 s    [User: 4.148 s, System: 0.554 s]
  Range (min … max):    1.895 s …  2.834 s    10 runs

Benchmark 2: pre-commit install-hooks
  Time (mean ± σ):     30.325 s ±  1.180 s    [User: 39.897 s, System: 4.673 s]
  Range (min … max):   28.766 s … 33.107 s    10 runs

Summary
  'prek install-hooks' ran
   14.30 ± 1.96 times faster than 'pre-commit install-hooks'

@tpoliaw
Copy link
Contributor Author

tpoliaw commented Feb 16, 2026

Actually running the checks is much closer as most of the hooks are the same

❯ hyperfine --warmup 10 'prek run --all-files' 'pre-commit run --all-files'                                                                                                                                                           12:11:01
Benchmark 1: prek run --all-files
  Time (mean ± σ):     261.4 ms ±   4.5 ms    [User: 210.7 ms, System: 95.1 ms]
  Range (min … max):   256.6 ms … 272.2 ms    10 runs

Benchmark 2: pre-commit run --all-files
  Time (mean ± σ):     815.3 ms ± 120.0 ms    [User: 1418.7 ms, System: 217.3 ms]
  Range (min … max):   749.5 ms … 1138.0 ms    10 runs

Summary
  'prek run --all-files' ran
    3.12 ± 0.46 times faster than 'pre-commit run --all-files'

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.

2 participants