astral-sh / astral-sh/uv-pre-commit
Support for pre-commit with monorepos that use ```[tool.uv.sources]``` (non-workspace layout)
- Dominant language
- Python
- Stars
- 348
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to use the official ```uv``` pre-commit hooks in a monorepo with multiple interdependent apps/libraries wired via ```[tool.uv.sources]```, but without using ```uv``` workspaces?
I saw an example in the ```README.md``` showing a hardcoded subdirectory path, but doing this for every project in a growing monorepo could become cumbersome.
From reading the docs, the pre-commit integration appears to assume either a single project or a workspace. In our setup we intentionally do not use workspaces (as suggested under [“When not to use workspaces”](https://docs.astral.sh/uv/concepts/projects/workspaces/#when-not-to-use-workspaces)), and rely on ```[tool.uv.sources]``` to link local packages.
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the README.md example that uses a hardcoded subdirectory path, then read uv’s “When not to use workspaces” guidance linked in the issue. Define how official pre-commit hooks should handle multiple projects connected through [tool.uv.sources] without requiring one path per project; done means the supported workflow is clear and avoids that repeated configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100