Skip to content

Commit dd42768

Browse files
authored
Update README.md
Add the formatEnabled option
1 parent fd5711b commit dd42768

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff 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

8789
Coming from previous versions the only change is that `isort` rules are **not** applied by default.
8890
To enable sorting of imports using ruff's isort functionality, add `"I"` to the list of `format` rules.

0 commit comments

Comments
 (0)