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
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 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.
@@ -58,19 +65,20 @@ the valid configuration keys:
58
65
-`pylsp.plugins.ruff.enabled`: boolean to enable/disable the plugin. `true` by default.
59
66
-`pylsp.plugins.ruff.config`: Path to optional `pyproject.toml` file.
60
67
-`pylsp.plugins.ruff.exclude`: Exclude files from being checked by `ruff`.
61
-
-`pylsp.plugins.ruff.executable`: Path to the `ruff` executable. Assumed to be in PATH by default.
68
+
-`pylsp.plugins.ruff.executable`: Path to the `ruff` executable. Uses `os.executable -m "ruff"` by default.
62
69
-`pylsp.plugins.ruff.ignore`: Error codes to ignore.
63
70
-`pylsp.plugins.ruff.extendIgnore`: Same as ignore, but append to existing ignores.
64
71
-`pylsp.plugins.ruff.lineLength`: Set the line-length for length checks.
65
72
-`pylsp.plugins.ruff.perFileIgnores`: File-specific error codes to be ignored.
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