502 if uv isnt used dont add a pre commit config relying on uv#1023
Conversation
CodSpeed Performance ReportMerging #1023 will not alter performanceComparing Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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
No description provided.