Skip to content

Commit 4f84996

Browse files
authored
Merge pull request #6 from ewjoachim/ewjoachim-patch-1
2 parents a0caf24 + 70266a9 commit 4f84996

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,54 @@
1616
pre-commit hook. This is mainly useful for hooks that need a complete environment to
1717
run, like static type checkers (`mypy`, `pyright`, etc.).
1818

19+
## What?
20+
21+
If your `.pre-commit-config.yaml` file looks like this:
22+
```yaml
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.11.11
25+
hooks:
26+
- id: ruff
27+
```
28+
but your `uv.lock` says you're using ruff at version `0.12.0`, then the hook will change
29+
`.pre-commit-config.yaml` to:
30+
```diff
31+
- repo: https://github.com/astral-sh/ruff-pre-commit
32+
- rev: v0.11.11
33+
+ rev: v0.12.0
34+
hooks:
35+
- id: ruff
36+
```
37+
38+
And if it looks like this:
39+
```yaml
40+
- repo: https://github.com/RobertCraigie/pyright-python
41+
rev: v1.1.400
42+
hooks:
43+
- id: pyright
44+
additional_dependencies:
45+
- django-stubs==5.1.3
46+
```
47+
And you've added configuration in `pyproject.toml` to synchronize the
48+
`additional_dependencies` with the uv dependency group named `types`:
49+
```toml
50+
[tool.sync-pre-commit-with-uv.pyright-python]
51+
pypi_package_name = "pyright"
52+
additional_dependencies_uv_params = ["--group", "types"]
53+
```
54+
Then when uv upgrades `django-stubs` to 5.1.4, the hook will upgrade
55+
`.pre-commit-config.yaml` to:
56+
```diff
57+
- repo: https://github.com/RobertCraigie/pyright-python
58+
rev: v1.1.400
59+
hooks:
60+
- id: pyright
61+
additional_dependencies:
62+
- - django-stubs==5.1.3
63+
+ - django-stubs==5.1.4
64+
```
65+
66+
1967
## Installation & Usage
2068

2169
```yaml

0 commit comments

Comments
 (0)