英文:
How to enable Pylint extension to show "E202" error on VSCode?
问题
我在VSCode上编写了以下代码:
""""Say Hello""""
print("Hello" )
然后,Flake8扩展可以显示E202
错误,针对print("Hello" )
如下所示:
在
)
之前有空格 Flake8(E202)
但是,Pylint扩展无法显示E202
错误,针对print("Hello" )
如下所示:
那么,我如何启用Pylint扩展来在VSCode上显示E202
错误呢?
英文:
I wrote the code below on VSCode:
"""Say Hello"""
print("Hello" )
Then, Flake8 extension can show E202
error for print("Hello" )
as shown below:
> whitespace before ')' Flake8(E202)
But, Pylint extension cannot show E202
error for print("Hello" )
as shown below:
So, how can I enable Pylint extension to show E202
error on VSCode?
答案1
得分: 1
bad-whitespace 错误已从 pylint 中移除。查看这个问题。
所有消息都在这里。
答案2
得分: -1
pylint没有规则来捕捉这种类型的问题。
如果我使用CLI命令,我可以看到pylint不会将此问题显示为问题:
$ cat /tmp/a.py
print("Hello" )
$ pylint /tmp/a.py
************* Module a
/tmp/a.py:1:0: C0114: Missing module docstring (missing-module-docstring)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
$ flake8 /tmp/a.py
/tmp/a.py:2:15: E202 whitespace before ')'
所以,pylint扩展不会显示它。
英文:
pylint does not have a rule to catch that type of issues.
If I use the CLI commands, I can see that pylint does not show this as a problem:
$ cat /tmp/a.py
print("Hello" )
$ pylint /tmp/a.py
************* Module a
/tmp/a.py:1:0: C0114: Missing module docstring (missing-module-docstring)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
$ flake8 /tmp/a.py
/tmp/a.py:2:15: E202 whitespace before ')'
So, the pylint extension does not show it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论