File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ pylsp = {
4545 plugins = {
4646 ruff = {
4747 enabled = true , -- Enable the plugin
48+ formatEnabled = true , -- Enable formatting using ruffs formatter
4849 executable = " <path-to-ruff-bin>" , -- Custom path to ruff
4950 config = " <path_to_custom_ruff_toml>" , -- Custom config for ruff to use
5051 extendSelect = { " I" }, -- Rules that are additionally used by ruff
@@ -81,8 +82,9 @@ With `v2.0.0` it is also possible to use patterns to match codes. Rules match if
8182
8283## Code formatting
8384
84- With ` python-lsp-ruff>1.6.0 ` formatting is done using [ ruffs own formatter] ( https://docs.astral.sh/ruff/formatter/ ) .
85- In addition, rules that should be fixed during the ` textDocument/formatting ` request can be added with the ` format ` option.
85+ With ` python-lsp-ruff>1.6.0 ` formatting is done using [ ruffs own formatter] ( https://docs.astral.sh/ruff/formatter/ ) by default.
86+ Formatting using ruff can be explicitly disabled by setting ` formatEnabled = false ` in the LSP settings.
87+ Additional rules that should be fixed during the ` textDocument/formatting ` request can be added with the ` format ` option.
8688
8789Coming from previous versions the only change is that ` isort ` rules are ** not** applied by default.
8890To enable sorting of imports using ruff's isort functionality, add ` "I" ` to the list of ` format ` rules.
You can’t perform that action at this time.
0 commit comments