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
Run ruff format when lsp formatting is invoked (#57)
* Run `ruff format` when lsp formatting is invoked
Adds the Subcommand enum to indicate which `ruff` subcommand should be
executed by `run_ruff`. At this time, only `check` and `format` are
supported. As different subcommands support different parameters,
argument generation is delegated based on the specific subcommand value.
The `ruff format` subcommand does not currently organize imports and
there does not appear to be a way to convince it to do so. Until a
unified command exists the approach taken here is to format and then
make a second run of `ruff check` that _only_ performs import
formatting.
* Preserve compatibility with `format` settings
Codes listed in this setting should be included in fixes performed as
part of a formatting pass.
* Make import sorting opt-in
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ the valid configuration keys:
78
78
-`pylsp.plugins.ruff.perFileIgnores`: File-specific error codes to be ignored.
79
79
-`pylsp.plugins.ruff.select`: List of error codes to enable.
80
80
-`pylsp.plugins.ruff.extendSelect`: Same as select, but append to existing error codes.
81
-
-`pylsp.plugins.ruff.format`: List of error codes to fix during formatting. The default is`["I"]`, any additional codes are appended to this list.
81
+
-`pylsp.plugins.ruff.format`: List of error codes to fix during formatting. Empty by default, use`["I"]` here to get import sorting as part of formatting.
82
82
-`pylsp.plugins.ruff.unsafeFixes`: boolean that enables/disables fixes that are marked "unsafe" by `ruff`. `false` by default.
83
83
-`pylsp.plugins.ruff.severities`: Dictionary of custom severity levels for specific codes, see [below](#custom-severities).
0 commit comments