mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-07 21:25:08 +00:00
Fix doc for Neovim setting examples (#18491)
## Summary This PR fixes an error in the example Neovim configuration on [this documentation page](https://docs.astral.sh/ruff/editors/settings/#configuration). The `configuration` block should be nested under `settings`, consistent with other properties and as outlined [here](https://docs.astral.sh/ruff/editors/setup/#neovim). I encountered this issue when copying the example to configure ruff integration in my neovim - the config didn’t work until I corrected the nesting. ## Test Plan - [x] Confirmed that the corrected configuration works in a real Neovim + Ruff setup - [x] Verified that the updated configuration renders correctly in MkDocs <img width="382" alt="image" src="https://github.com/user-attachments/assets/0722fb35-8ffa-4b10-90ba-c6e8417e40bf" />
This commit is contained in:
parent
db8db536f8
commit
8d24760643
1 changed files with 16 additions and 12 deletions
|
@ -66,7 +66,9 @@ _Using configuration file path:_
|
||||||
```lua
|
```lua
|
||||||
require('lspconfig').ruff.setup {
|
require('lspconfig').ruff.setup {
|
||||||
init_options = {
|
init_options = {
|
||||||
configuration = "~/path/to/ruff.toml"
|
settings = {
|
||||||
|
configuration = "~/path/to/ruff.toml"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -117,20 +119,22 @@ _Using inline configuration:_
|
||||||
```lua
|
```lua
|
||||||
require('lspconfig').ruff.setup {
|
require('lspconfig').ruff.setup {
|
||||||
init_options = {
|
init_options = {
|
||||||
configuration = {
|
settings = {
|
||||||
lint = {
|
configuration = {
|
||||||
unfixable = {"F401"},
|
lint = {
|
||||||
["extend-select"] = {"TID251"},
|
unfixable = {"F401"},
|
||||||
["flake8-tidy-imports"] = {
|
["extend-select"] = {"TID251"},
|
||||||
["banned-api"] = {
|
["flake8-tidy-imports"] = {
|
||||||
["typing.TypedDict"] = {
|
["banned-api"] = {
|
||||||
msg = "Use `typing_extensions.TypedDict` instead"
|
["typing.TypedDict"] = {
|
||||||
|
msg = "Use `typing_extensions.TypedDict` instead"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
format = {
|
||||||
|
["quote-style"] = "single"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
format = {
|
|
||||||
["quote-style"] = "single"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue