Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use Ruff version from PATH? #105

Open
FCamborda opened this issue Nov 22, 2024 · 1 comment
Open

Is there a way to use Ruff version from PATH? #105

FCamborda opened this issue Nov 22, 2024 · 1 comment
Labels
question Further information is requested

Comments

@FCamborda
Copy link

Hi,

currently we setup our pre-commit specifying a revision for Ruff.

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).

@FCamborda FCamborda changed the title Is there a way to use system Ruff? Is there a way to use Ruff version from PATH? Nov 22, 2024
@MichaReiser
Copy link
Member

As I understand it, the main reason for using Ruff's pre-commit plugin is that it installs the specific Ruff version for you.

I'm not a pre-commit user myself, but could you try using the system plugin to run an arbitrary command, in this case, ruff?

@MichaReiser MichaReiser added the question Further information is requested label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants