Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython · GitHub
Open Graph Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython
X Title: Replace pre-commit with prek for faster linting · Issue #143148 · python/cpython
Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined version of pre-commit, [...] designed to be a...
Open Graph Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined versi...
X Description: Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined ...
Opengraph URL: https://github.com/python/cpython/issues/143148
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Replace pre-commit with prek for faster linting","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nFirst, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template.\n\n[prek](https://github.com/j178/prek) is a \"reimagined version of pre-commit, [...] designed to be a faster, dependency-free and drop-in alternative\".\nIt has already been adopted by major projects from Apache, FastAPI, and Django (see [prek/Who is using prek?](https://github.com/j178/prek#who-is-using-prek)).\n\nRunning prek against the entire CPython codebase yields a speedup of almost 2.5x without a cache and 1.25x with a warm cache.\n\n```shell\nhyperfine --warmup 2 --runs 5 \\\n --prepare \"prek cache clean\" \"prek run --all-files\" \\\n --prepare \"pre-commit clean\" \"pre-commit run --all-files\"\nBenchmark 1: prek run --all-files\n Time (mean ± σ): 19.835 s ± 0.290 s [User: 50.857 s, System: 6.248 s]\n Range (min … max): 19.527 s … 20.201 s 5 runs\n\nBenchmark 2: pre-commit run --all-files\n Time (mean ± σ): 48.944 s ± 0.448 s [User: 76.063 s, System: 6.096 s]\n Range (min … max): 48.522 s … 49.681 s 5 runs\n\nSummary\n prek run --all-files ran\n 2.47 ± 0.04 times faster than pre-commit run --all-files\n```\n\n```shell\nhyperfine --warmup 2 --runs 5 \\\n \"prek run --all-files\" \\\n \"pre-commit run --all-files\"\nBenchmark 1: prek run --all-files\n Time (mean ± σ): 6.763 s ± 0.124 s [User: 35.990 s, System: 2.134 s]\n Range (min … max): 6.589 s … 6.900 s 5 runs\n\nBenchmark 2: pre-commit run --all-files\n Time (mean ± σ): 8.537 s ± 0.048 s [User: 43.797 s, System: 1.903 s]\n Range (min … max): 8.484 s … 8.608 s 5 runs\n\nSummary\n prek run --all-files ran\n 1.26 ± 0.02 times faster than pre-commit run --all-files\n```\n\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-143149\n* gh-143359\n* gh-143360\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/juhannc","@type":"Person","name":"juhannc"},"datePublished":"2025-12-24T15:26:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/143148/cpython/issues/143148"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:010cd8eb-348a-e7b0-00b1-8945ae126c0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAF0:3C8DFE:1120FF2:170E20F:6973E26D |
| html-safe-nonce | 1b6bf736912745bf5d1a507e1da607b81c25f2a0255f9d6c44f753e2a4ac97df |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUYwOjNDOERGRToxMTIwRkYyOjE3MEUyMEY6Njk3M0UyNkQiLCJ2aXNpdG9yX2lkIjoiNjE0MzA5NzQxMDUxNzY1MzU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2f392f6f18d4cd9ff5d9a3639980de727de3b94d5f5c45a4e2a35e6e1d5fc884 |
| hovercard-subject-tag | issue:3760582217 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/143148/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d3dd7c41dbc2cce90f02461d27275f1108f83f693d1ab9c8fedc6c3666b0991/python/cpython/issues/143148 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d3dd7c41dbc2cce90f02461d27275f1108f83f693d1ab9c8fedc6c3666b0991/python/cpython/issues/143148 |
| og:image:alt | Feature or enhancement Proposal: First, I hope this is the correct issue template. If not, please let me know, and I can resubmit the proposal using the proper template. prek is a "reimagined versi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | juhannc |
| hostname | github.com |
| expected-hostname | github.com |
| None | bcae444bf5f475d712cb2ad536c10eaebd406c84ae2d3a77c5f05aee5010c786 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7da815895d8ce3ba55f0017efb5a34bac921756a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width