Skip to content

Commit f47bd6a

Browse files
authored
Avoid using an empty list as a default argument to a function (#155)
1 parent e7f3501 commit f47bd6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bundled/tool/lsp_server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,15 @@ def _get_settings_by_document(document: workspace.Document | None):
369369
def _run_tool_on_document(
370370
document: workspace.Document,
371371
use_stdin: bool = False,
372-
extra_args: Sequence[str] = [],
372+
extra_args: Optional[Sequence[str]] = None,
373373
) -> utils.RunResult | None:
374374
"""Runs tool on the given document.
375375
376376
if use_stdin is true then contents of the document is passed to the
377377
tool via stdin.
378378
"""
379+
if extra_args is None:
380+
extra_args = []
379381
if str(document.uri).startswith("vscode-notebook-cell"):
380382
# TODO: Decide on if you want to skip notebook cells.
381383
# Skip notebook cells

0 commit comments

Comments
 (0)