Visual studio code suppress pep8 warnings

后端 未结 10 1279
滥情空心
滥情空心 2021-01-31 14:52

How can I suppress pep8 warnings, in Visual studio code? What I want to do is to suppress E501 warning I don\'t want to get warnings where my code length is more than 80 chars.

相关标签:
10条回答
  • 2021-01-31 15:29

    I found the answer at https://code.visualstudio.com/docs/python/linting for vscode 1.31.1

    solved it via modify settings.json

    {
        "workbench.iconTheme": "material-icon-theme",
        "workbench.colorTheme": "Material Theme Ocean",
        "git.autofetch": true,
        "python.linting.flake8Args": ["--ignore=E501", "--verbose"]
    }

    0 讨论(0)
  • 2021-01-31 15:33

    Either use setup.cfg for single project or change your user settings for all py files.

    {
        "python.linting.pycodestyleEnabled": true,
        "python.linting.pycodestyleArgs": [
            "--ignore=E501" 
        ]
    }
    

    Before October 2019 all pycodestyle settings were named pep8:

    {
        "python.linting.pep8Enabled": true,
        "python.linting.pep8Args": [
            "--ignore=E501" 
        ]
    }
    
    0 讨论(0)
  • 2021-01-31 15:38

    To ignore multiple pycodestyle warnings:

    {
        "python.linting.pycodestyleEnabled": true,
        "python.linting.pycodestyleArgs": [
            "--ignore=E501,W503" 
        ]
    }
    
    0 讨论(0)
  • 2021-01-31 15:44

    this worked for me:

    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": ["--ignore=E501"]
    
    0 讨论(0)
提交回复
热议问题