如何在VSCode上启用Pylint扩展以显示“E202”错误?

huangapple go评论85阅读模式
英文:

How to enable Pylint extension to show "E202" error on VSCode?

问题

我在VSCode上编写了以下代码:

""""Say Hello""""

print("Hello"    )

然后,Flake8扩展可以显示E202错误,针对print("Hello" )如下所示:

如何在VSCode上启用Pylint扩展以显示“E202”错误?

)之前有空格 Flake8(E202)

但是,Pylint扩展无法显示E202错误,针对print("Hello" )如下所示:

如何在VSCode上启用Pylint扩展以显示“E202”错误?

那么,我如何启用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:

如何在VSCode上启用Pylint扩展以显示“E202”错误?

> whitespace before ')' Flake8(E202)

But, Pylint extension cannot show E202 error for print("Hello" ) as shown below:

如何在VSCode上启用Pylint扩展以显示“E202”错误?

So, how can I enable Pylint extension to show E202 error on VSCode?

答案1

得分: 1

bad-whitespace 错误已从 pylint 中移除。查看这个问题

所有消息都在这里

英文:

The bad-whitespace error has been removed from pylint. check this issue

all messages are here

答案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.

huangapple
  • 本文由 发表于 2023年6月11日 20:32:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76450495.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定