Skip to content

Rogue "missing return statement" errors #62

@CallumAtCarter

Description

@CallumAtCarter

I am running the latest pre-release version of the extension with mypy 1.4.0 in the environment with "mypy-type-checker.importStrategy": "fromEnvironment".

Quite often when opening a file, I am greeted with the following error on most of the lines:

Missing return statement [return]

Upon opening the extension logs, I can see that these errors appear to be coming from one or more type stubs:

2023-06-22 15:17:44.757 [info] [Trace - 3:17:44 PM] Received notification 'window/logMessage'.
2023-06-22 15:17:44.758 [info] file:///c%3A/Users/me/Documents/GitHub/project/some/file.py :
.venv\lib\site-packages\requests-stubs\api.pyi:10:1:28:18: error: Missing return statement  [return]
...
.venv\lib\site-packages\requests-stubs\api.pyi:137:1:154:18: error: Missing return statement  [return]
.venv\lib\site-packages\requests-stubs\sessions.pyi:315:1:315:29: error: Missing return statement  [return]
.venv\lib\site-packages\requests-stubs\utils.pyi:25:1:25:88: error: Missing return statement  [return]
...
.venv\lib\site-packages\requests-stubs\utils.pyi:68:5:68:44: error: Missing return statement  [return]
.venv\lib\site-packages\urllib3-stubs\filepost.pyi:14:1:14:33: error: Missing return statement  [return]
.venv\lib\site-packages\urllib3-stubs\filepost.pyi:15:1:15:75: error: Missing return statement  [return]
.venv\lib\site-packages\urllib3-stubs\filepost.pyi:17:1:17:106: error: Missing return statement  [return]

I don't see any of these errors when running mypy .

I tried adding exclude = [".venv/"] to my pyproject.toml file to no avail.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from postertriage-needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions