Swap out references to pre-commit with prek - #645
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved documentation recommendations still reference retired or contradictory pre-commit integrations.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR migrates repository and generated-project linting from pre-commit to prek while retaining .pre-commit-config.yaml compatibility.
Changes:
- Updates dependencies, CI workflows, commands, and caching.
- Refreshes documentation, contributor guidance, and badges.
- Removes reliance on
@pre-commit-ciand synchronizes generated fixtures.
File summaries
| File | Summary | Review notes |
|---|---|---|
tests/data/test_package_generation/README.md |
Updates generated README badge. | — |
tests/data/test_package_generation/pyproject.toml |
Updates generated development dependency. | — |
tests/data/test_package_generation/.github/workflows/linting.yml |
Updates generated lint workflow. | — |
docs/pages/tutorial.md |
Documents prek installation and usage. |
Nit (2 votes): Update the contradictory pre-commit recommendation and link in docs/pages/linting.md:16. |
CONTRIBUTING.md |
Updates contributor instructions and links. | — |
{{cookiecutter.project_slug}}/README.md |
Updates the template README badge. | — |
{{cookiecutter.project_slug}}/pyproject.toml |
Replaces the development dependency. | — |
{{cookiecutter.project_slug}}/.github/workflows/linting.yml |
Updates template linting workflow. | — |
.github/workflows/linting.yml |
Runs repository and template linting with prek. |
Nit (2 votes): Update or remove the stale pre-commit.ci recommendation in docs/pages/ci.md:14. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
samcunliffe
left a comment
There was a problem hiding this comment.
Happy to merge as-is. Just wondered if pre-commit should be Avoid?
| | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: | | ||
| | [pre-commit](https://pre-commit.com/) | Universal tool which performs a git hook on commit, allows you to run linters/formatters on any code. A tool to automatically run many of the tools listed below. | <span class="label label-green">Best</span> | | ||
| | [prek](https://prek.j178.dev/) | A rust-powered improvement on `pre-commit`. Known for its friendlier community and feature rich implementation. | <span class="label label-green">Best</span> | | ||
| | [pre-commit](https://pre-commit.com/) | Universal tool which performs a git hook on commit, allows you to run linters/formatters on any code. A tool to automatically run many of the tools listed below. | <span class="label label-yellow">Good</span> | |
There was a problem hiding this comment.
Keep yellow or move to red? Is there any reason not to use prek?
There was a problem hiding this comment.
Interesting question. I guess it depends on how we define 🔴 Vs 🟡. I would have said 🟡 is that there isn't anything "wrong" with pre-commit. However, the bug identified in #644 suggests otherwise as that is an actual blocker.
There was a problem hiding this comment.
Leave as is and chat with other pythonistas IRL at TI planning?
|
Deploy failure coming from #647. |
This PR removes the repos reliance on
pre-commitin favour ofprek.prekis faster, has a welcoming community, and is the future of linting.preksupports.pre-commit-config.yamlso no need to change anything really, and in the future we could consider moving towards its customprek.tomlformat.As part of this work I have uninstalled @pre-commit-ci. We weren't configuring it any more (i.e. no
ci:block in.pre-commit-config.yaml) and it was causing bugs #644.Fixes #644.