Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio code suppress pep8 warnings

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. I'm using Don Jayamanne's Python extension and here is my config file for vscode

{     "python.linting.pylintEnabled": false,     "python.linting.pep8Enabled": true,     "python.pythonPath": "/workspace/virtualenvs/abr/bin/python3",     "python.linting.enabled": true } 

I know that there is one another option "python.linting.pep8Args": [] but I couldn't to get it work. I've installed pep8 on virtualenv

What I've already tried.

  1. "python.linting.pep8Args": ['--ignore=E501']
  2. "Searched all visual studio code settings"
like image 438
latsha Avatar asked Nov 27 '16 17:11

latsha


People also ask

How do I turn off warnings in VS Code?

To disable TypeScript warnings in VS Code, we can set a few options in our VS Code settings to disable them. { //... "typescript. validate. enable": false, "javascript.

How do you turn off lint in VS Code?

You might want to disable linting by setting the vscode setting "r. lsp. diagnostics": false . Or you might want to customize the list of linters to be used by editing ~/.

How do I fix Visual Studio code lint issues?

Go to File > Preferences > Settings (or Code > Preferences > Settings). Then click settings. json . Now, undo the fixes you made to the JavaScript file you created earlier.


2 Answers

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"      ] } 
like image 115
Juan Rada Avatar answered Sep 22 '22 15:09

Juan Rada


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

like image 27
mangatinanda Avatar answered Sep 22 '22 15:09

mangatinanda