Skip to content

Add sync-with-uv for repos using pre-commit with uv#1005

Merged
nathanjmcdougall merged 3 commits intomainfrom
1002-add-sync-with-uv-by-default-when-adding-pre-commit-with-uv-backend
Oct 13, 2025
Merged

Add sync-with-uv for repos using pre-commit with uv#1005
nathanjmcdougall merged 3 commits intomainfrom
1002-add-sync-with-uv-by-default-when-adding-pre-commit-with-uv-backend

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 13, 2025

CodSpeed Performance Report

Merging #1005 will degrade performances by 9.11%

Comparing 1002-add-sync-with-uv-by-default-when-adding-pre-commit-with-uv-backend (ba2f306) with main (bd036f6)

Summary

❌ 1 (👁 1) regression
✅ 1 untouched

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
👁 Instrumentation test_several_tools_add_and_remove 1.1 s 1.3 s -9.11%

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator Author

Regression because we need to detect the backend now when using pre-commit

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review October 13, 2025 19:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds the sync-with-uv pre-commit hook for repositories using uv as their backend. The hook helps keep UV dependencies synchronized in pre-commit configurations.

  • Adds sync-with-uv hook to pre-commit configurations when using the uv backend
  • Updates test expectations to include the new hook in the appropriate order
  • Extracts version constants for better maintainability

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/usethis/_tool/impl/pre_commit.py Implements pre-commit configuration with sync-with-uv hook for uv backend
src/usethis/_tool/impl/pyproject_fmt.py Extracts version constant for pyproject-fmt
src/usethis/_integrations/pre_commit/hooks.py Adds sync-with-uv to hook ordering
src/usethis/_core/tool.py Ensures PreCommitTool's config is added first
tests/ Updates test expectations to include sync-with-uv hook

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nathanjmcdougall nathanjmcdougall merged commit 3010dad into main Oct 13, 2025
18 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1002-add-sync-with-uv-by-default-when-adding-pre-commit-with-uv-backend branch October 13, 2025 19:52
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.

Add sync-with-uv by default when adding pre-commit with uv backend

2 participants