File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ pylsp = {
45
45
plugins = {
46
46
ruff = {
47
47
enabled = true , -- Enable the plugin
48
+ formatEnabled = true , -- Enable formatting using ruffs formatter
48
49
executable = " <path-to-ruff-bin>" , -- Custom path to ruff
49
50
config = " <path_to_custom_ruff_toml>" , -- Custom config for ruff to use
50
51
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
81
82
82
83
## Code formatting
83
84
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.
86
88
87
89
Coming from previous versions the only change is that ` isort ` rules are ** not** applied by default.
88
90
To 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