astral-sh / astral-sh/ruff-pre-commit

Is there a way to use Ruff version from PATH?

Open
#105 3 comments 2 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
2k
Forks
105
Avg merge
8h 36m
Merged PRs (30d)
1

Description

Hi,

currently we setup our pre-commit specifying a revision for Ruff.
```yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
```

This installs Ruff with version 0.8.0 and works very well. However, every time we upgrade our dependencies, we have to maintain different places where the Ruff version is defined.
We would like for pre-commit to use Ruff as-is found via PATH (either installed via Shell, or if installed in an isolated venv like with `uv tool install`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the pre-commit configuration and the ruff and ruff-format hook entries shown in the issue, then investigate how those hooks resolve Ruff when it is installed on PATH. Done means both hooks can use the PATH-installed Ruff while preserving the existing version-pinned behavior.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.