Skip to content

Swap out references to pre-commit with prek - #645

Merged
paddyroddy merged 6 commits into
mainfrom
paddy/issue-644
Sep 15, 2026
Merged

paddyroddy merged 6 commits into
mainfrom
paddy/issue-644

Conversation

@paddyroddy

Copy link
Copy Markdown
Member

This PR removes the repos reliance on pre-commit in favour of prek. prek is faster, has a welcoming community, and is the future of linting. prek supports .pre-commit-config.yaml so no need to change anything really, and in the future we could consider moving towards its custom prek.toml format.

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.

@paddyroddy
paddyroddy requested a lite review from Copilot September 15, 2026 12:15
@paddyroddy paddyroddy self-assigned this Sep 15, 2026
@paddyroddy paddyroddy added enhancement New feature or request p3-medium Medium priority labels Sep 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-ci and 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.

Comment thread .github/workflows/linting.yml
Comment thread docs/pages/tutorial.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified across the reviewed files.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@samcunliffe samcunliffe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge as-is. Just wondered if pre-commit should be Avoid?

Comment thread docs/pages/linting.md
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------: |
| [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> |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep yellow or move to red? Is there any reason not to use prek?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave as is and chat with other pythonistas IRL at TI planning?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's do it

@paddyroddy

Copy link
Copy Markdown
Member Author

Deploy failure coming from #647.

paddyroddy added a commit that referenced this pull request Sep 15, 2026
@paddyroddy
paddyroddy merged commit 7d794bd into main Sep 15, 2026
19 checks passed
@paddyroddy
paddyroddy deleted the paddy/issue-644 branch September 15, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request p3-medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace pre-commit.ci with a simple action that runs prek.

3 participants