Hemmelig
Hemmelig

Reputation: 794

Python in VSCode: Syntax highlighting, tabs and no pep8

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

Upvotes: 0

Views: 542

Answers (1)

Steven-MSFT
Steven-MSFT

Reputation: 8411

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"],

Upvotes: 1

Related Questions