astral-sh / astral-sh/uv-pre-commit

Hook to sync pre-commit repos with lockfile versions

Open
#23 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
348
Forks
27
PR merge metrics
No merged PRs in 30d

Description

An incredibly useful tool I've become accustomed to with Poetry/PDM is the use of a tool/plugin to sync the tagged pre-commit repo versions with the versions of the tools in the lockfile

See: https://github.com/GabDug/sync-pre-commit-lock

* implemented as plugin for Poetry/PDM that runs when ` lock` is called
* configured via `pyproject.toml`

See: https://github.com/floatingpurr/sync_with_poetry | https://github.com/floatingpurr/sync_with_pdm

* implemented as pre-commit hook written in Python
* configured with CLAs + `.pre-commit-config.yaml`

This way, whenever a tool version is updated the developer doesn't have to manually update the pre-commit config to keep the versions in-sync, especially sync `pre-commit autoupdate` will only update to the latest repo versions, which might conflict with the actual tool versions pinned by UV

Possibly related to: https://github.com/astral-sh/uv-pre-commit/issues/17

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the linked sync-pre-commit-lock, sync_with_poetry, and sync_with_pdm projects, then inspect the existing repository entry points. Compare the proposed Poetry/PDM plugin and Python pre-commit hook approaches, including pyproject.toml and .pre-commit-config.yaml configuration. Done means a documented, agreed approach for syncing tagged pre-commit repositories with versions pinned in the UV lockfile.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.