Originally posted by tdscheper March 21, 2025
When cwd is ${nearestConfig}, the extension only looks for pyproject.toml and mypy.ini, per this code:
|
if settings["cwd"] == "${nearestConfig}": |
|
workspaceFolder = pathlib.Path(settings["workspaceFS"]) |
|
candidate = pathlib.Path(document.path).parent |
|
# check if pyproject exists |
|
check_for = ["pyproject.toml", "mypy.ini"] |
|
# until we leave the workspace |
|
while candidate.is_relative_to(workspaceFolder): |
|
for n in check_for: |
|
candidate_file = candidate / n |
|
if candidate_file.is_file(): |
|
log_to_output( |
|
f"found {n}, using {candidate}", lsp.MessageType.Debug |
|
) |
|
return os.fspath(candidate) |
|
# starting from the current file and working our way up |
|
else: |
|
candidate = candidate.parent |
|
else: |
|
log_to_output( |
|
f"failed to find {', '.join(check_for)}; using workspace root", |
|
lsp.MessageType.Debug, |
|
) |
|
return settings["workspaceFS"] |
Shouldn't it also look for .mypy.ini and setup.cfg, since this is what Mypy does?
Discussed in https://github.com/microsoft/vscode-mypy/discussions/356
Originally posted by tdscheper March 21, 2025
When
cwdis${nearestConfig}, the extension only looks forpyproject.tomlandmypy.ini, per this code:vscode-mypy/bundled/tool/lsp_server.py
Lines 659 to 681 in 7559016
Shouldn't it also look for
.mypy.iniandsetup.cfg, since this is what Mypy does?