mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
![]() ## Summary This PR partially addresses #16418 via the following: - `LinterSettings::unresolved_python_version` is now a `TargetVersion`, which is a thin wrapper around an `Option<PythonVersion>` - `Checker::target_version` now calls `TargetVersion::linter_version` internally, which in turn uses `unwrap_or_default` to preserve the current default behavior - Calls to the parser now call `TargetVersion::parser_version`, which calls `unwrap_or_else(PythonVersion::latest)` - The `Checker`'s implementation of `SemanticSyntaxContext::python_version` also uses `TargetVersion::parser_version` to use `PythonVersion::latest` for semantic errors In short, all lint rule behavior should be unchanged, but we default to the latest Python version for the new syntax errors, which should minimize confusing version-related syntax errors for users without a version configured. ## Test Plan Existing tests, which showed no changes (except for printing default settings). |
||
---|---|---|
.. | ||
assets | ||
docs | ||
resources/test/fixtures | ||
src | ||
tests | ||
Cargo.toml | ||
CONTRIBUTING.md | ||
README.md |
The Ruff Language Server
ruff server
is a language server that powers Ruff's editor integrations.
The job of the language server is to listen for requests from the client (in this case, the code editor of your choice) and call into Ruff's linter and formatter crates to construct real-time diagnostics or formatted code, which is then sent back to the client. It also tracks configuration files in your editor's workspace, and will refresh its in-memory configuration whenever those files are modified.
Refer to the documentation for more information on how to set up the language server with your editor and configure it to your liking.
Contributing
Contributions are welcome and highly appreciated. To get started, check out the contributing guidelines.
You can also join us on Discord.