-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider changing default Mypy Arguments setting to avoid spurious errors when used with warn_unused_ignores #192
Comments
Ah, just realised this ended up as a bug because I didn't switch templates when I worked out what the cause was. Feel free to reclassify as a feature request. |
Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision. |
* remove extention Pylance * set "python.linting.mypyArgs" https://github.com/microsoft/vscode-python/issues/12619 のワークアラウンド
vscode-mypy/bundled/tool/lsp_server.py Lines 88 to 95 in d8d062f
These are the defaults, they are now minimized to only those values that we really need for the server to work. |
Environment data
Expected behaviour
I generally expect that my editor will give the same linter experience as running a linter directly on the command line.
Actual behaviour
For the case of
warn_unused_ignores
in combination with atype: ignore
comment on an import line, runningmypy
through VSCode differs from the command line experience and thus from what any scripted runs (including CI) would output. This results from the vscode-python extension passing non-default arguments tomypy
which override behaviours the user may have configured in their project.Steps to reproduce:
I'm using
asttokens
here, but I've seen this with other libraries too (for exampleparso
andjedi
). The common theme is that it is a library which doesn't have type annotations.Command line run:
VSCode Output tab output:
I had initially assumed that this was a bug in vscode-python and it was only while reviewing the
mypy
setting to check I didn't have any changes I should include in the bug report that I spotted the non-default arguments which vscode-python passes tomypy
.I can definitely see why the chosen options were set -- to reduce the noise from
mypy
for new users who may not have configuredmypy
themselves, however this leads to a non-obvious difference betweenmypy
in the editor andmypy
on the command line.I can see that it may be somewhat reasonable for an editor to have false negatives (or hide errors) relative to the command line, however the issue here is that these options create false positives -- errors in the editor which it is not clear how to resolve and which do not reproduce elsewhere. This leads to a reduction in trust that the editor and/or
mypy
is reporting the right things.The text was updated successfully, but these errors were encountered: