-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Diagnostic Data
- Python version (& distribution if applicable, e.g., Anaconda): python 3.14.2
- Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv (uv)
- Operating system (and version): fedora 43
- Version of tool extension you are using: 2025.2.0
Behaviour
Expected Behavior
When mypy reports "no-untyped-def", it should be visually discernible from other errors in a function.
Actual Behavior
When mypy reports "no-untyped-def", the entire function is highlighted red. This way, the red underline masks other errors and adds a ton of visual noise to the screen. In particular, for files without any type annotations, but where I want the errors on because we'll be adding types eventually, it makes it very difficult to visually parse the file when everything is underlined red.
Reproduction Steps:
Example python file -
def foo(a: str):
if a == True: return 1
return a + b + c
And in pyproject.toml, I have configured tool.mypy.strict = true.
This results in highlighting like so.
Compare to this example where the function return type is added and it's much easier to see the other errors in the function and much less noisy.
Similar example with more code -
It seems like this error should only cause it to highlight the function declaration, not all source code under the function.