Vscode中的Python:语法突出显示,标签和无PEP8

发布于 2025-01-23 18:41:37 字数 780 浏览 1 评论 0原文

我已经重新安装了我的PC,并为正确初始化Vscode而疯狂。 我想在python中使用语法突出显示,我使用标签而不是空间,我不想看到PEP8警告。

在调试调试之后,我没有语法突出显示,由于选项卡引起的错误,我看到了所有PEP8

警告

{
    "[python]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 4  
      },
      "python.linting.enabled": false,
      "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
      },
      "java.semanticHighlighting.enabled": true,
      "terminal.integrated.enableMultiLinePasteWarning": false
      
}

。做?

编辑:重新加载后,有关太空与选项卡的消息消失了。

I have reinstalled my PC and get crazy about initialising VScode correctly.
I want to use syntax highlighting in Python, I use tabs instead of space and I don't want to see pep8 warnings.

After ours of debugging, I dont have syntax highlighting, errors due to tabs and I see all pep8 warnings.????

I have installed Python and Pylance as extensions and currently, my settings.json looks like this:

{
    "[python]": {
        "editor.insertSpaces": true,
        "editor.tabSize": 4  
      },
      "python.linting.enabled": false,
      "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
      },
      "java.semanticHighlighting.enabled": true,
      "terminal.integrated.enableMultiLinePasteWarning": false
      
}

Is there anybody who can knows what to do?

Edit: After reloading, the messages about space vs tabs have disappeared.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中性美 2025-01-30 18:41:37

如果您想忽略Pylint提示的消息,则可以在settings.json中添加此消息:

"python.linting.pylintArgs": ["--disable", "C"],

它的意思是 this

Convention (C)
Refactor (R)
Warning (W)
Error (E)
Fatal (F)

您可以这样做,以禁用多种类型的消息:

“ python.linting.pylintargs”:[ - disable',disable”,“ c,r,r,w”],

If you want to ignore the messages prompted by the pylint you can add this in the settings.json:

"python.linting.pylintArgs": ["--disable", "C"],

And it means this:

Convention (C)
Refactor (R)
Warning (W)
Error (E)
Fatal (F)

And you can do it like this to disable multi types of the message:

"python.linting.pylintArgs": ["--disable", "C,R,W"],

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文