Run ruff via prek local system hooks, on Markdown too - #168
Merged
Conversation
Move ruff off the astral-sh/ruff-pre-commit mirror, which pinned its own ruff version separate from the one in uv.lock, and only linted/formatted Python files. Local system hooks always use `uv run ruff`, matching the project's pinned version, and ruff-format now also runs on Markdown files, catching drift like the one just fixed in the lock-file-maintenance PR.
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
Comment on lines
+42
to
+43
| language = "system" | ||
| types = ["python"] |
There was a problem hiding this comment.
The original remote hook was pinned to a specific version (v0.15.9). By switching to a local system hook with language = "system", version pinning is lost. Different environments may have different ruff versions installed, leading to inconsistent behavior. Consider using a versioned tool like uvx ruff@0.15.9 or maintaining a lock file for the development environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
astral-sh/ruff-pre-commitmirror repo (revv0.15.9) with localsystem-language hooks that calluv run ruff check --fixanduv run ruff format, so prek always uses the same ruff version asuv.lock/CI instead of a separately-pinned mirror revision.ruff-formatnow runs against Markdown files as well as Python (types_or = ["python", "markdown"]), so drift in fenced Python code blocks in docs (like the one just fixed on Lock file maintenance #154) is caught locally instead of only in CI.Test plan
prek run --all-filespasses cleanlyruff-formatcatches and fixes reformatted Markdown code blocks (tested by intentionally breaking quote style in a doc, confirming the hook flags/fixes it, then reverting)ruff-checkstill only targets Python files (ruff doesn't lint embedded Markdown code)