From 8d2476064325e11f489434d804a23df24b8fb744 Mon Sep 17 00:00:00 2001 From: shimies Date: Fri, 6 Jun 2025 18:49:16 +0900 Subject: [PATCH] Fix doc for Neovim setting examples (#18491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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 image --- docs/editors/settings.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/editors/settings.md b/docs/editors/settings.md index 1eb36af3a6..d15d145ef0 100644 --- a/docs/editors/settings.md +++ b/docs/editors/settings.md @@ -66,7 +66,9 @@ _Using configuration file path:_ ```lua require('lspconfig').ruff.setup { init_options = { - configuration = "~/path/to/ruff.toml" + settings = { + configuration = "~/path/to/ruff.toml" + } } } ``` @@ -117,20 +119,22 @@ _Using inline configuration:_ ```lua require('lspconfig').ruff.setup { init_options = { - configuration = { - lint = { - unfixable = {"F401"}, - ["extend-select"] = {"TID251"}, - ["flake8-tidy-imports"] = { - ["banned-api"] = { - ["typing.TypedDict"] = { - msg = "Use `typing_extensions.TypedDict` instead" + settings = { + configuration = { + lint = { + unfixable = {"F401"}, + ["extend-select"] = {"TID251"}, + ["flake8-tidy-imports"] = { + ["banned-api"] = { + ["typing.TypedDict"] = { + msg = "Use `typing_extensions.TypedDict` instead" + } } } + }, + format = { + ["quote-style"] = "single" } - }, - format = { - ["quote-style"] = "single" } } }