Visual studio code suppress pep8 warnings

落爺英雄遲暮 提交于 2019-12-02 20:11:56

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

{
    "python.linting.pep8Enabled": true,
     "python.linting.pep8Args": [
         "--ignore=E501" 
     ]
}
mangatinanda

If you want to change the line length, add this in your User Settings file

{ 
  "python.linting.pep8Enabled": true,
  "python.linting.pep8Args": ["--max-line-length=120" ]
}

previous code was giving me 'EOF' error, so i edited it

I was fighting with this a couple of weeks ago. What I ended up doing was adding a setup.cfg file into the root folder of my project and putting the following in it:

[pep8]
ignore = E501
Jamie Cha

Please try double qoute " instead of single '

['--ignore=E501'] --> ["--ignore=E501"]

It worked for me. Don't forget to restart the program.

this worked for me:

"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--ignore=E501"]
wei

What you did is correct. However you have to start the VScode to see the difference. (I would prefer vs auto update itself.)

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"]
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!