Skip to content

Replace pre-commit with prek for improved linting performance - #110

Merged
nstarman merged 7 commits into
mainfrom
copilot/switch-from-pre-commit-to-prek
Sep 1, 2026
Merged

Replace pre-commit with prek for improved linting performance#110
nstarman merged 7 commits into
mainfrom
copilot/switch-from-pre-commit-to-prek

Conversation

Copilot AI commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Migrate from pre-commit to prek, a performant Rust-based alternative with identical configuration compatibility. This improves hook execution speed while maintaining the exact same linting behavior.

Changes

  • Dependencies: Swap pre-commit>=4.5.0prek>=0.4.0 in pyproject.toml lint group
  • Nox integration: Update noxfile.py to invoke prek run --all-files and rename session precommit()prek_session()
  • Documentation: Update contributor guides to reference prek install/run commands
  • CI: Rename job pre-commitprek in workflow; exclude prek-ci in release config

No configuration changes needed—prek accepts .pre-commit-config.yaml as-is. All existing hooks work without modification.

# Before
s.run("pre-commit", "run", "--all-files", *s.posargs)

# After
s.run("prek", "run", "--all-files", *s.posargs)

Copilot AI and others added 3 commits August 23, 2026 02:17
Co-authored-by: nstarman <8949649+nstarman@users.noreply.github.com>
Co-authored-by: nstarman <8949649+nstarman@users.noreply.github.com>
…nstall docs

Co-authored-by: nstarman <8949649+nstarman@users.noreply.github.com>
Copilot AI changed the title Switch from pre-commit to prek Replace pre-commit with prek for improved linting performance Aug 23, 2026
Copilot AI requested a review from nstarman August 23, 2026 02:21
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/release.yml Outdated
Comment thread noxfile.py Outdated
Comment thread noxfile.py Outdated
Co-authored-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
Copilot AI requested a review from nstarman August 23, 2026 03:10
@nstarman nstarman added this to the v1.1.0 milestone Sep 1, 2026
Comment thread .github/CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
@nstarman
nstarman marked this pull request as ready for review September 1, 2026 08:54
Copilot AI lite review requested due to automatic review settings September 1, 2026 08:54

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.

Pull request overview

This PR migrates the project’s linting hook runner from pre-commit to prek (pre-commit-compatible) to improve hook execution performance while keeping the existing .pre-commit-config.yaml behavior.

Changes:

  • Swap the lint dependency from pre-commit to prek (and update uv.lock accordingly).
  • Update Nox to run prek run --all-files for the lint hook runner session.
  • Update contributor documentation to reference prek commands.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Removes pre-commit and its transitive deps; adds prek package resolution.
pyproject.toml Replaces lint-group dependency pre-commit>=4.5.0 with prek>=0.4.0.
noxfile.py Switches the hook runner invocation to prek run --all-files (but session naming needs alignment).
CONTRIBUTING.md Updates contributor commands to use prek (wording still references “pre-commit hooks”).
.github/CONTRIBUTING.md Updates commands to use prek (section header still says “Pre-commit”).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread noxfile.py
Comment thread CONTRIBUTING.md Outdated
Comment thread pyproject.toml
Comment on lines 68 to 70
lint = [
"pre-commit>=4.5.0",
"prek>=0.4.0",
"pylint==4.0.4",
Comment thread .github/CONTRIBUTING.md
@nstarman

nstarman commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

@copilot fix the prek-identified lint error.

Co-authored-by: nstarman <8949649+nstarman@users.noreply.github.com>

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the prek-identified lint error.

Fixed in 43c6b10 by applying the prettier formatting change to CONTRIBUTING.md so the prek lint run passes.

Copilot AI requested a review from nstarman September 1, 2026 09:10
@nstarman
nstarman merged commit 431ed26 into main Sep 1, 2026
19 checks passed
@nstarman
nstarman deleted the copilot/switch-from-pre-commit-to-prek branch September 1, 2026 09:31
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.

3 participants