Skip to content

Commit 6a01dd3

Browse files
committed
update with new config
1 parent 40184ec commit 6a01dd3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ pip install python-lsp-ruff
1717

1818
There also exists an [AUR package](https://aur.archlinux.org/packages/python-lsp-ruff).
1919

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
2128

2229
This plugin will disable `pycodestyle`, `pyflakes`, `mccabe` and `pyls_isort` by default, unless they are explicitly enabled in the client configuration.
2330
When enabled, all linting diagnostics will be provided by `ruff`.
@@ -43,7 +50,7 @@ lspconfig.pylsp.setup {
4350
}
4451
```
4552

46-
# Configuration
53+
## Configuration
4754

4855
Configuration options can be passed to the python-language-server. If a `pyproject.toml`
4956
file is present in the project, `python-lsp-ruff` will use these configuration options.
@@ -66,11 +73,12 @@ the valid configuration keys:
6673
- `pylsp.plugins.ruff.select`: List of error codes to enable.
6774
- `pylsp.plugins.ruff.extendSelect`: Same as select, but append to existing error codes.
6875
- `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.
6977
- `pylsp.plugins.ruff.severities`: Dictionary of custom severity levels for specific codes, see [below](#custom-severities).
7078

7179
For more information on the configuration visit [Ruff's homepage](https://beta.ruff.rs/docs/configuration/).
7280

73-
## Custom severities
81+
### Custom severities
7482

7583
By default, all diagnostics are marked as warning, except for `"E999"` and all error codes starting with `"F"`, which are displayed as errors.
7684
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

Comments
 (0)