You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does the following:
- Updates the pyproject.toml file to only support ruff>=0.1.0
- Add the `--unsafe-fixes` option to the LSP config
Co-authored-by: Julian Hoßbach <julian.hossbach@gmx.de>
Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,14 @@ pip install python-lsp-ruff
17
17
18
18
There also exists an [AUR package](https://aur.archlinux.org/packages/python-lsp-ruff).
19
19
20
-
# Usage
20
+
### When using ruff before version 0.1.0
21
+
Ruff version `0.1.0` introduced API changes that are fixed in Python LSP Ruff `v1.6.0`. To continue with `ruff<0.1.0` please use `v1.5.3`, e.g. using `pip`:
22
+
23
+
```sh
24
+
pip install "ruff<0.1.0""python-lsp-ruff==1.5.3"
25
+
```
26
+
27
+
## Usage
21
28
22
29
This plugin will disable `pycodestyle`, `pyflakes`, `mccabe` and `pyls_isort` by default, unless they are explicitly enabled in the client configuration.
23
30
When enabled, all linting diagnostics will be provided by `ruff`.
@@ -43,7 +50,7 @@ lspconfig.pylsp.setup {
43
50
}
44
51
```
45
52
46
-
# Configuration
53
+
##Configuration
47
54
48
55
Configuration options can be passed to the python-language-server. If a `pyproject.toml`
49
56
file is present in the project, `python-lsp-ruff` will use these configuration options.
@@ -66,11 +73,12 @@ the valid configuration keys:
66
73
-`pylsp.plugins.ruff.select`: List of error codes to enable.
67
74
-`pylsp.plugins.ruff.extendSelect`: Same as select, but append to existing error codes.
68
75
-`pylsp.plugins.ruff.format`: List of error codes to fix during formatting. The default is `["I"]`, any additional codes are appended to this list.
76
+
-`pylsp.plugins.ruff.unsafeFixes`: boolean that enables/disables fixes that are marked "unsafe" by `ruff`. `false` by default.
69
77
-`pylsp.plugins.ruff.severities`: Dictionary of custom severity levels for specific codes, see [below](#custom-severities).
70
78
71
79
For more information on the configuration visit [Ruff's homepage](https://beta.ruff.rs/docs/configuration/).
72
80
73
-
## Custom severities
81
+
###Custom severities
74
82
75
83
By default, all diagnostics are marked as warning, except for `"E999"` and all error codes starting with `"F"`, which are displayed as errors.
76
84
This default can be changed through the `pylsp.plugins.ruff.severities` option, which takes the error code as a key and any of
0 commit comments