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
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,5 +66,17 @@ the valid configuration keys:
66
66
-`pylsp.plugins.ruff.select`: List of error codes to enable.
67
67
-`pylsp.plugins.ruff.extendSelect`: Same as select, but append to existing error codes.
68
68
-`pylsp.plugins.ruff.format`: List of error codes to fix during formatting. The default is `["I"]`, any additional codes are appended to this list.
69
+
-`pylsp.plugins.ruff.severities`: Dictionary of custom severity levels for specific codes, see [below](#custom-severities).
69
70
70
71
For more information on the configuration visit [Ruff's homepage](https://beta.ruff.rs/docs/configuration/).
72
+
73
+
## Custom severities
74
+
75
+
By default all diagnostics are marked as warning, except for `"E999"` and all error codes starting with `"F"`, which are displayed as errors.
76
+
This default can be changed through the `pylsp.plugins.ruff.severities` option, which takes the error code as a key and any of
77
+
`"E"`, `"W"`, `"I"` and `"H"` to be displayed as errors, warnings, information and hints, respectively.
78
+
For more information on the diagnostic severities please refer to
79
+
[the official LSP reference](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticSeverity).
80
+
81
+
Note that `python-lsp-ruff` does *not* accept regex, and it will *not* check whether the error code exists. If the custom severity level is not displayed,
82
+
please check first that the error code is correct and that the given value is one of the possible keys from above.
0 commit comments