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

Support for intentionally using an older version of ruff #440

Open
Tracked by #480
harshita-gupta opened this issue Apr 3, 2024 · 2 comments
Open
Tracked by #480

Support for intentionally using an older version of ruff #440

harshita-gupta opened this issue Apr 3, 2024 · 2 comments
Labels
question Further information is requested

Comments

@harshita-gupta
Copy link

I work at an organization that (for various reasons) is currently on an older version of ruff - 0.1.6, to be exact. We're working on upgrading our codebase to be compatible with newer ruff versions, but until then, is there a way for me to tell the extension that it's ok to use an old version of ruff found in the environment?

@zanieb
Copy link
Member

zanieb commented Apr 3, 2024

Generally, we support running with a version of Ruff you provide instead of the one in the environment.

I believe that version meets most of the requirements specified in our language server: https://github.com/astral-sh/ruff-lsp/blob/f4705a7664b0e41732bcd374614776c5c96ae124/ruff_lsp/server.py#L146-L153

Are you having difficulties providing the path to Ruff? https://github.com/astral-sh/ruff-vscode#settings

@charliermarsh
Copy link
Member

v0.1.6 should work for most things, with the exception of range formatting:

# Require at least Ruff v0.0.291 for formatting, but allow older versions for linting.
VERSION_REQUIREMENT_FORMATTER = SpecifierSet(">=0.0.291")
VERSION_REQUIREMENT_LINTER = SpecifierSet(">=0.0.189")
VERSION_REQUIREMENT_RANGE_FORMATTING = SpecifierSet(">=0.2.1")
# Version requirement for use of the `--output-format` option
VERSION_REQUIREMENT_OUTPUT_FORMAT = SpecifierSet(">=0.0.291")
# Version requirement after which Ruff avoids writing empty output for excluded files.
VERSION_REQUIREMENT_EMPTY_OUTPUT = SpecifierSet(">=0.1.6")

@MichaReiser MichaReiser added the question Further information is requested label Apr 4, 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

4 participants