-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ruff server
in v0.4.5
doesn't consider the configuration setting in Neovim
#11507
Comments
Can you provide a minimal code snippet on which it's failing? And, just to confirm, by "failing" do you mean that the v0.4.4 wasn't raising any violations but v0.4.5 does? |
@dhruvmanila |
I haven't been able to reproduce this issue. The |
I think I found the bug. |
ruff server
in v0.4.5
doesn't consider the configuration setting in Neovim
…ed (#11566) ## Summary This PR fixes the bug to avoid flattening the global-only settings for the new server. This was added in #11497, possibly to correctly de-serialize an empty value (`{}`). But, this lead to a bug where the configuration under the `settings` key was not being read for global-only variant. By using #[serde(default)], we ensure that the settings field in the `GlobalOnly` variant is optional and that an empty JSON object `{}` is correctly deserialized into `GlobalOnly` with a default `ClientSettings` instance. fixes: #11507 ## Test Plan Update the snapshot and existing test case. Also, verify the following settings in Neovim: 1. Nothing ```lua ruff = { cmd = { '/Users/dhruv/work/astral/ruff/target/debug/ruff', 'server', '--preview', }, } ``` 2. Empty dictionary ```lua ruff = { cmd = { '/Users/dhruv/work/astral/ruff/target/debug/ruff', 'server', '--preview', }, init_options = vim.empty_dict(), } ``` 3. Empty `settings` ```lua ruff = { cmd = { '/Users/dhruv/work/astral/ruff/target/debug/ruff', 'server', '--preview', }, init_options = { settings = vim.empty_dict(), }, } ``` 4. With some configuration: ```lua ruff = { cmd = { '/Users/dhruv/work/astral/ruff/target/debug/ruff', 'server', '--preview', }, init_options = { settings = { configuration = '/tmp/ruff-repro/pyproject.toml', }, }, } ```
When I updated to version 0.4.5, the E30* checks all failed and nothing changed in my configuration
my pyproject.toml
my ruff config
The text was updated successfully, but these errors were encountered: