Conversation
96208a8 to
801dc83
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR migrates from pre-commit to prek, a Rust-based alternative that promises better performance and compatibility. The migration replaces the Python-based pre-commit tool with prek while maintaining the same functionality for code quality checks.
Key changes:
- Updates dependency from pre-commit to prek in development requirements
- Replaces GitHub Actions workflow to use prek-action instead of pre-commit
- Updates documentation to reflect the new tool and installation instructions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| requirements/dev.txt | Replaces pre-commit dependency with prek |
| README.rst | Updates documentation section from "Pre-commit checks" to "prek checks" with new installation instructions |
| .github/workflows/prek.yml | Adds new GitHub Actions workflow for prek |
| .github/workflows/pre-commit.yml | Removes old pre-commit workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| Pre-commit checks | ||
| prek checks | ||
| ----------------- | ||
| `pre-commit <https://pre-commit.com>`_ is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks. |
There was a problem hiding this comment.
This line describes pre-commit but appears in a section about prek. The description should be updated to describe prek instead.
| `pre-commit <https://pre-commit.com>`_ is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks. | |
| `prek <https://prek.j178.dev/>`_ is a tool for running git hooks, similar to pre-commit, but designed to be faster and dependency-free. |
There was a problem hiding this comment.
I understand you intentionally left pre-commit sentence here. What's your goal in doing that?
There was a problem hiding this comment.
@pauloxnet That text is from prek's readme. I didn't leave it there, I copied it from https://github.com/j178/prek/blob/ee7110b49bb1aa8d7b3ccee51c5241550cb0aec2/README.md . If this is somehow confusing, I'm open for recommendations.
0b9e031 to
11d339a
Compare
|
Apart from this PRs merge status, we can disable |
pauloxnet
left a comment
There was a problem hiding this comment.
I added a couple of minor comments.
Thanks for the PR. I approved it.
| Pre-commit checks | ||
| prek checks | ||
| ----------------- | ||
| `pre-commit <https://pre-commit.com>`_ is a framework to run hooks written in many languages, and it manages the language toolchain and dependencies for running the hooks. |
There was a problem hiding this comment.
I understand you intentionally left pre-commit sentence here. What's your goal in doing that?
|
Rebased and resolved the conflicts. Do we have any concerns about this change? What is needed for the next step? |
I approved. I hope other can test it and approve it too. |
e23275e to
69fb6df
Compare
ff9c0ce to
e6bb488
Compare
|
FastAPI migrated to prek from pre-commit just yesterday: fastapi/fastapi#14572 I think we can follow their example. |
|
I think we started this a long time ago. What's the blockers? |
|
@pauloxnet None, just waiting for the merge. I rebased the PR and updated version references - it's good as new now. |
I reviewed and approved again. Let's merge this. |
|
@django/django-website-mergers 🍹 |
SaptakS
left a comment
There was a problem hiding this comment.
I am mostly fine with this. I do find prek to be a slightly new project (latest release being 0.2.23 which kind of indicates the maintainer considers this project still in development). But if everyone else is okay with that, I am fine.
Since 3 people are in favor of this PR, and others haven't commented at all, I assume they are not against it or don't have an opinion on it. Other big projects like FastAPI just moved to prek. Based on that I propose to merge. |
django#2252 (comment) Co-authored-by: Saptak Sengupta <saptak013@gmail.com>
|
BTW other projects are migrating too from pre-commit to prek |
django#2252 (comment) Co-authored-by: Saptak Sengupta <saptak013@gmail.com>
pre-commit development was stagnant for a while and now there is a strong alternative that's been writen with Rust: https://github.com/j178/prek
prek's readme list its features as
I tested it with the projects I'm working on and things are working fine, and even better because prek is faster while installing and running the hook dependencies.
We had a small discussion about the issues with pre-commit's maintenance and agreed to give a chance to prek, on Slack.
I tried to implement the simplest config for CI. We can also implement an optimized workflow with UV, similar to this one and shave off a couple more seconds from the runtime but I'm not sure that is necessary.