Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Commit f75aa86

Browse files
committed
fix(pydocstyle): use uv run --frozen --no-sync to stop touching uv state
`uv run ruff check --select D` triggers `uv sync` on every invocation, which rebuilds workspace members and writes to uv.lock / .venv install state. prek then reports these as "files were modified by this hook" and fails the hook even when no docstring lint errors fire — every consumer with workspace members on uv saw pydocstyle flapping on each prek run. Mirrors the v1.1.4 mypy fix: `uv run --frozen --no-sync` skips re-sync entirely and uses the existing lockfile / .venv as-is. Surfaced on html-to-markdown's prek run after the v1.1.9 bump (which re-enabled godoc-lint and exposed the pydocstyle flap).
1 parent ca75da9 commit f75aa86

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12+
- `pydocstyle`: stop triggering "files modified by this hook" via `uv run`.
13+
The hook ran `uv run ruff check --select D`, which `uv sync`s the workspace
14+
on every invocation and touches `uv.lock` / `.venv/`. prek then reports
15+
these as "files were modified" and fails the hook even when no docstring
16+
lint errors fire. Switched to `uv run --frozen --no-sync` — same mitigation
17+
the v1.1.4 mypy hook adopted. Surfaced on html-to-markdown's prek run.
18+
(`hooks/pydocstyle/run.sh`)
19+
1220
- `godoc-lint`: fix `golangci-lint` version-detection regex. The v1.1.5
1321
v2-compat patch used `sed -n 's/.*version v\([0-9]\+\).*/\1/p'`, which
1422
(a) requires the `v` prefix that current `golangci-lint version` output

hooks/pydocstyle/run.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ if ((${#targets[@]} == 0)); then
2424
fi
2525

2626
if command -v uv >/dev/null 2>&1; then
27-
base_cmd=(uv run ruff check --select D)
27+
# `uv run` would `uv sync` the workspace and touch `uv.lock` / `.venv/`,
28+
# which prek then reports as "files were modified by this hook" — failing
29+
# the hook even when no docstring lint errors fire. `--frozen --no-sync`
30+
# matches the v1.1.4 mypy fix and the same rationale.
31+
base_cmd=(uv run --frozen --no-sync ruff check --select D)
2832
elif command -v ruff >/dev/null 2>&1; then
2933
base_cmd=(ruff check --select D)
3034
elif command -v python >/dev/null 2>&1; then

0 commit comments

Comments
 (0)