forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Closed
Copy link
Labels
area-lintingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issue
Description
Environment data
- VS Code version: 1.58.2
- Extension version (available under the Extensions sidebar): v2021.7.1060902895 (Python)
- OS and version: macOS Mojave - 10.14.6
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.12, 3.7.9
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: mypy==0.812
- Relevant/affected Python-related VS Code extensions and their versions: v2021.7.1060902895
- Value of the
python.languageServersetting: Pylance
Expected behaviour
I expect squiggly lines under characters where mypy error occurs.
Actual behaviour
Output logs indicate error but there is no visual indication of a simple mypy error.
Steps to reproduce:
- Create file in folder or with name such that the path length is greater than >80 char long.
- Ensure
--prettyis an argument to mypy and linting for mypy is enabled. - Add following code:
x: int = 's'- Note the lack of visual indication of error from mypy.
Script to reproduce:
mkdir test
cd test
echo "x: int = 's'" >> no_visual_error_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.py
echo "x: int = 's'" >> visual_error.py
echo '{
"folders": [
{
"path": "."
}
],
"settings": {
"python.linting.mypyArgs": [
"--pretty"
],
"python.linting.mypyEnabled": true
}
}' >> test.code-workspace
code test.code-workspaceLogs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
> ~/.pyenv/shims/python -m mypy --pretty ~/test/visual_error.py
cwd: ~/test
> ~/.pyenv/shims/python -m mypy --pretty ~/test/visual_error.py
cwd: ~/test
##########Linting Output - mypy##########
visual_error.py:1: error: Incompatible types in assignment (expression has type
"str", variable has type "int")
x: int = 's'
^
Found 1 error in 1 file (checked 1 source file)
> ~/.pyenv/shims/python -m mypy --pretty ~/test/no_visual_error_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.py
cwd: ~/test
> ~/.pyenv/shims/python -m mypy --pretty ~/test/no_visual_error_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.py
cwd: ~/test
##########Linting Output - mypy##########
no_visual_error_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.py:1: error:
Incompatible types in assignment (expression has type "str", variable has type
"int")
x: int = 's'
^
Found 1 error in 1 file (checked 1 source file)
Metadata
Metadata
Assignees
Labels
area-lintingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buggood first issue