Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zzstoatzz
Copy link
Collaborator

migrate from pre-commit to prek for faster, more efficient git hooks with zero developer friction.

prek is a rust-based reimplementation of pre-commit that's faster, uses less disk space, and is fully compatible with existing .pre-commit-config.yaml files.

changes

  • replaced pre-commit with prek in dev dependencies
  • updated CI workflow to use prek run --all-files
  • updated all documentation references (AGENTS.md, README.md, contributing.mdx)
  • verified all hooks pass with prek

benefits

  • faster: multiple times faster than pre-commit
  • smaller: uses half the disk space
  • drop-in: fully compatible with existing config
  • better ux: improved commands and shell completions

tested locally - all hooks pass ✓

🤖 Generated with Claude Code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Walkthrough

Replaces references to pre-commit with prek across the contributing guide: installation steps, hook installation and execution, command invocations, headings, failing-check messaging, and the Before Submitting workflow; pytest workflow separation unchanged.

Changes

Cohort / File(s) Summary
Documentation terminology update
docs/development/contributing.mdx
Replaced pre-commit references with prek across installation instructions, hook setup and execution, command examples (e.g., uv run prek install, uv run prek run --all-files), section headings (e.g., "Pre-commit hooks" → "Prek hooks", "Pre-Commit Checks" → "Prek Checks"), failing-check messaging, and submission steps.

Poem

🐰 The prek hops in, fresh and spry,
Old hooks step back with a wink of an eye,
Commands rebloom, now tidy and neat,
Docs skip along on nimble feet,
A rabbit's little hop—clean, swift, complete.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description provides a clear and detailed narrative about the changes, including what was modified, why the migration is beneficial, and confirmation of local testing. However, the description is missing critical sections from the required template: the entire Contributors Checklist (with items about issue closure, workflow adherence, testing, and documentation updates) and the Review Checklist (with self-review confirmation). While the author has addressed these topics informally in their description, they have not followed the structured template format with the required checkbox verification sections. The description should be updated to include the missing Contributors Checklist and Review Checklist sections with all required checkboxes completed. The author should explicitly check off each item confirming they have followed the development workflow, tested the changes, updated documentation, performed self-review, and are ready for review.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "switch from pre-commit to prek" directly and accurately summarizes the main change in the changeset. The raw summary confirms the changes are focused on replacing pre-commit references with prek throughout the documentation, and the title is concise, specific, and avoids vague terminology. A teammate scanning the commit history would immediately understand that this is a tool migration from pre-commit to prek.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch switch-to-prek

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2727f25 and f10858b.

📒 Files selected for processing (1)
  • docs/development/contributing.mdx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/.cursor/rules/mintlify.mdc)

docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write instructions and procedures in second person ("you")
Use active voice over passive voice
Use present tense for current states and future tense for outcomes
Maintain consistent terminology across the documentation
Keep sentences concise while preserving necessary context
Use parallel structure in lists, headings, and procedures
Lead with the most important information (inverted pyramid)
Use progressive disclosure: basic concepts before advanced ones
Break complex procedures into numbered steps
Include prerequisites and context before instructions
Provide expected outcomes for each major step
End sections with next steps or related information
Use descriptive, keyword-rich headings for navigation and SEO
Focus on user goals and outcomes rather than system features
Anticipate common questions and address them proactively
Include troubleshooting for likely failure points
Offer multiple pathways when appropriate (beginner vs advanced) and provide an opinionated recommended path
Use for supplementary information that supports the main content
Use for expert advice, shortcuts, or best practices
Use for critical cautions, breaking changes, or destructive actions
Use for neutral background or contextual information
Use to confirm success or completion
Provide single code examples using fenced code blocks with language (and filename when relevant)
Use to present the same concept in multiple languages
For API docs, use to show requests
For API docs, use to show responses
Use and to document procedures and sequential instructions
Use and for platform-specific or alternative approaches
Use / for supplementary content that might interrupt flow
In API docs, use for parameters (path, body, query, header) with type and required/default as appropria...

Files:

  • docs/development/contributing.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

docs/**/*.{md,mdx}: Documentation code examples should be explained before the code and be fully runnable, including imports
Use clear headers with logical H2/H3 hierarchy to form navigation
Write user-focused content that motivates the why before the how
Prefer prose for important information over code comments in docs

Files:

  • docs/development/contributing.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{md,mdx}: Be brief and to the point in written materials; avoid regurgitating obvious code details
Avoid defensive constructions like "This isn't X" or "Not just X, but Y"; state what it is directly

Files:

  • docs/development/contributing.mdx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-27T14:40:00.422Z
Learning: Run uv sync, pre-commit (Ruff + Prettier + ty), and pytest in sequence before committing; all must pass
📚 Learning: 2025-10-27T14:40:00.422Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-27T14:40:00.422Z
Learning: Run uv sync, pre-commit (Ruff + Prettier + ty), and pytest in sequence before committing; all must pass

Applied to files:

  • docs/development/contributing.mdx
🪛 LanguageTool
docs/development/contributing.mdx

[grammar] ~115-~115: Ensure spelling is correct
Context: ...ately as a distinct workflow step after prek checks pass. CI will reject PRs that fai...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Run tests: Python 3.10 on ubuntu-latest
  • GitHub Check: Run tests with lowest-direct dependencies
  • GitHub Check: Run tests: Python 3.10 on windows-latest
🔇 Additional comments (4)
docs/development/contributing.mdx (4)

52-58: Installation steps correctly updated to prek.

The transition from pre-commit to prek is consistent here, and the message about hooks running automatically remains appropriate.


110-115: Tool list and pytest separation now correct.

The previous review flagged an incorrect prek tools list; this version now correctly includes Prettier and explicitly notes that Pytest runs as a separate workflow step. This aligns with the documented pre-commit configuration (Ruff, Prettier, ty) and the project's development workflow.


158-158: Before Submitting step correctly runs both prek and pytest.

The command properly chains prek checks with pytest execution, maintaining the required workflow.


1-162: Migration from pre-commit to prek is comprehensive and well-executed.

The changes consistently replace pre-commit references with prek throughout the contributing guide. The tool list has been corrected from the previous review feedback (Prettier is now included, Pytest properly noted as separate), and all commands properly use uv run prek ... for consistency with the project's tooling. The Before Submitting workflow correctly chains both prek and pytest execution.

To ensure completeness of the migration across all documentation, please verify that the changes to AGENTS.md and README.md (mentioned in the PR summary) are similarly consistent and don't contain any residual pre-commit references.


Comment @coderabbitai help to get the list of available commands and usage tips.

@marvin-context-protocol marvin-context-protocol bot added the enhancement Improvement to existing functionality. For issues and smaller PR improvements. label Oct 29, 2025
@jlowin
Copy link
Owner

jlowin commented Nov 1, 2025

@zzstoatzz lgtm, any reason its draft / to not merge?

@zzstoatzz zzstoatzz marked this pull request as ready for review November 1, 2025 20:37
@zzstoatzz
Copy link
Collaborator Author

@zzstoatzz lgtm, any reason its draft / to not merge?

nope! was going to ask if you thought it was worth it/necessary, it seems to work great, just forgot to ask. should be good to merge as is if it looks good to you

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2d317e and 2727f25.

⛔ Files ignored due to path filters (5)
  • .github/workflows/run-static.yml is excluded by none and included by none
  • AGENTS.md is excluded by none and included by none
  • README.md is excluded by none and included by none
  • pyproject.toml is excluded by none and included by none
  • uv.lock is excluded by !**/*.lock and included by none
📒 Files selected for processing (1)
  • docs/development/contributing.mdx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/.cursor/rules/mintlify.mdc)

docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write instructions and procedures in second person ("you")
Use active voice over passive voice
Use present tense for current states and future tense for outcomes
Maintain consistent terminology across the documentation
Keep sentences concise while preserving necessary context
Use parallel structure in lists, headings, and procedures
Lead with the most important information (inverted pyramid)
Use progressive disclosure: basic concepts before advanced ones
Break complex procedures into numbered steps
Include prerequisites and context before instructions
Provide expected outcomes for each major step
End sections with next steps or related information
Use descriptive, keyword-rich headings for navigation and SEO
Focus on user goals and outcomes rather than system features
Anticipate common questions and address them proactively
Include troubleshooting for likely failure points
Offer multiple pathways when appropriate (beginner vs advanced) and provide an opinionated recommended path
Use for supplementary information that supports the main content
Use for expert advice, shortcuts, or best practices
Use for critical cautions, breaking changes, or destructive actions
Use for neutral background or contextual information
Use to confirm success or completion
Provide single code examples using fenced code blocks with language (and filename when relevant)
Use to present the same concept in multiple languages
For API docs, use to show requests
For API docs, use to show responses
Use and to document procedures and sequential instructions
Use and for platform-specific or alternative approaches
Use / for supplementary content that might interrupt flow
In API docs, use for parameters (path, body, query, header) with type and required/default as appropria...

Files:

  • docs/development/contributing.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

docs/**/*.{md,mdx}: Documentation code examples should be explained before the code and be fully runnable, including imports
Use clear headers with logical H2/H3 hierarchy to form navigation
Write user-focused content that motivates the why before the how
Prefer prose for important information over code comments in docs

Files:

  • docs/development/contributing.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{md,mdx}: Be brief and to the point in written materials; avoid regurgitating obvious code details
Avoid defensive constructions like "This isn't X" or "Not just X, but Y"; state what it is directly

Files:

  • docs/development/contributing.mdx
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-10-27T14:38:52.613Z
Learning: Applies to docs/**/*.mdx : Maintain consistent terminology across the documentation
📚 Learning: 2025-10-27T14:38:52.614Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-10-27T14:38:52.614Z
Learning: Applies to docs/**/*.mdx : Check for consistency in terminology, formatting, and component usage

Applied to files:

  • docs/development/contributing.mdx
📚 Learning: 2025-10-27T14:40:00.422Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-27T14:40:00.422Z
Learning: Run uv sync, pre-commit (Ruff + Prettier + ty), and pytest in sequence before committing; all must pass

Applied to files:

  • docs/development/contributing.mdx
🔇 Additional comments (3)
docs/development/contributing.mdx (3)

52-54: Installation command correctly updated to prek.

The migration from pre-commit install to uv run prek install is consistent with the tool change and maintains the existing structure. As per coding guidelines, the code block format and installation steps are clear and follow second-person perspective.


58-58: Hook terminology updated consistently.

The description correctly refers to "Prek hooks" and clearly communicates the automatic behavior on commit using active voice and present tense, aligning with documentation standards.


158-158: Before Submitting command correctly updated and now explicitly complete.

The command uv run prek run --all-files && uv run pytest is an improvement over the implicit pre-commit behavior—it explicitly shows the full check sequence including pytest. The step numbering and clarity meet documentation guidelines.

Copy link
Owner

@jlowin jlowin left a comment

Choose a reason for hiding this comment

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

LGTM! Switched to using the action to cache envs

@jlowin jlowin merged commit aba7d76 into main Nov 2, 2025
12 of 13 checks passed
@jlowin jlowin deleted the switch-to-prek branch November 2, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality. For issues and smaller PR improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants