File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ There also exists an [AUR package](https://aur.archlinux.org/packages/python-lsp
2222This plugin will disable ` flake8 ` , ` pycodestyle ` , ` pyflakes ` and ` mccabe ` by default.
2323When enabled, all linting diagnostics will be provided by ` ruff ` .
2424
25+ This plugin will disable ` pyls_isort ` by default.
26+ When enabled, sorting of imports when formatting will be provided by ` ruff ` .
27+
2528# Configuration
2629
2730Configuration options can be passed to the python-language-server. If a ` pyproject.toml `
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ def pylsp_settings():
5959 "flake8" : {"enabled" : False },
6060 "mccabe" : {"enabled" : False },
6161 "pycodestyle" : {"enabled" : False },
62+ "pyls_isort" : {"enabled" : False },
6263 }
6364 }
6465 return converter .unstructure (settings )
@@ -345,11 +346,10 @@ def run_ruff_fix(workspace: Workspace, document: Document) -> str:
345346
346347def run_ruff_format (workspace : Workspace , document : Document ) -> str :
347348 settings = load_settings (workspace , document )
348- extra_arguments = []
349+ fixable_codes = ["I" ]
349350 if settings .format :
350- extra_arguments .append (f"--fixable={ ',' .join (settings .format )} " )
351- else :
352- extra_arguments .append ("--unfixable=ALL" )
351+ fixable_codes .extend (settings .format )
352+ extra_arguments = [f"--fixable={ ',' .join (fixable_codes )} " ]
353353 result = run_ruff (workspace , document , fix = True , extra_arguments = extra_arguments )
354354 return result
355355
You can’t perform that action at this time.
0 commit comments