Skip to content

Commit e5236cb

Browse files
committed
fix: ruff format message is shown even when it is disabled (my bad)
1 parent 3c02ff0 commit e5236cb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pylsp_ruff/plugin.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ def pylsp_format_document(workspace: Workspace, document: Document) -> Generator
117117
118118
"""
119119

120-
with workspace.report_progress("format: ruff"):
121-
log.debug(f"textDocument/formatting: {document}")
122-
outcome = yield
123-
result = outcome.get_result()
124-
if result:
125-
source = result[0]["newText"]
126-
else:
127-
source = document.source
120+
log.debug(f"textDocument/formatting: {document}")
121+
outcome = yield
122+
result = outcome.get_result()
123+
if result:
124+
source = result[0]["newText"]
125+
else:
126+
source = document.source
128127

129-
settings = load_settings(workspace=workspace, document_path=document.path)
130-
if not settings.format_enabled:
131-
return
128+
settings = load_settings(workspace=workspace, document_path=document.path)
129+
if not settings.format_enabled:
130+
return
132131

132+
with workspace.report_progress("format: ruff"):
133133
new_text = run_ruff_format(
134134
settings=settings, document_path=document.path, document_source=source
135135
)

0 commit comments

Comments
 (0)