Skip to content

502 if uv isnt used dont add a pre commit config relying on uv#1023

Merged
nathanjmcdougall merged 6 commits intomainfrom
502-if-uv-isnt-used-dont-add-a-pre-commit-config-relying-on-uv
Oct 16, 2025
Merged

502 if uv isnt used dont add a pre commit config relying on uv#1023
nathanjmcdougall merged 6 commits intomainfrom
502-if-uv-isnt-used-dont-add-a-pre-commit-config-relying-on-uv

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

@nathanjmcdougall nathanjmcdougall linked an issue Oct 16, 2025 that may be closed by this pull request
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Oct 16, 2025

CodSpeed Performance Report

Merging #1023 will not alter performance

Comparing 502-if-uv-isnt-used-dont-add-a-pre-commit-config-relying-on-uv (8874b34) with main (236a596)

Summary

✅ 2 untouched

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review October 16, 2025 19:59
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 PR fixes an issue where pre-commit configurations were being generated with uv dependencies even when uv wasn't being used as the project's backend. The changes ensure that when no backend is configured, alternative pre-commit hooks are provided that don't rely on uv.

Key changes:

  • Added backend detection logic to conditionally generate appropriate pre-commit configurations
  • Updated tool version dependencies (Ruff, pyproject-fmt)
  • Improved hook naming consistency

Reviewed Changes

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

Show a summary per file
File Description
src/usethis/_tool/impl/requirements_txt.py Added backend check to return empty pre-commit config when no backend is available
src/usethis/_tool/impl/import_linter.py Added backend-specific pre-commit configs with improved hook naming
src/usethis/_tool/impl/deptry.py Added backend-specific pre-commit configs for uv and none backends
tests/usethis/_tool/impl/test_requirements_txt.py Updated test expectation to reflect new behavior without uv
src/usethis/_tool/impl/ruff.py Bumped Ruff version to v0.14.1
src/usethis/_tool/impl/pyproject_fmt.py Bumped pyproject-fmt version to v2.11.0
src/usethis/_integrations/pre_commit/hooks.py Added lint_imports alias for import-linter
.pre-commit-config.yaml Improved import-linter hook display name

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

Revert Import Linter hook name changes
@nathanjmcdougall nathanjmcdougall merged commit 16f73ce into main Oct 16, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 502-if-uv-isnt-used-dont-add-a-pre-commit-config-relying-on-uv branch October 16, 2025 21:25
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.

If uv isn't used, don't add a pre-commit config relying on uv

2 participants