Repository navigation
no visual indication of mypy pretty linting errors on path names of >80 chars #16836
Copy link
Copy link
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)
Reactions are currently unavailable
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
Activity
[-]no visual indication of mypy linting errors on pathnames of >80 chars[/-][+]no visual indication of mypy pretty linting errors on path names of >80 chars[/+]karthiknadig commentedon Aug 4, 2021
tim (@timforby) Can you run this
mypy --pretty .from command line and share the output? I am not able to get errors or warning frommypyfrom the command line.timforby commentedon Aug 5, 2021
Karthik Nadig (@karthiknadig) Here you go:
karthiknadig commentedon Aug 5, 2021
Looks like with
--prettythe error printed out gets split into two lines. The regex we have formypyoutput parsing does not handle this scenario.vscode-python/src/client/linters/mypy.ts
Line 10 in f3ea0ec