-1

I am using Visual Studio Code, I am linting the code with flake8 and pycodestyle. I would like the line length error (E501) to be considered as a warning.

So far, the only thing that I could find was to ignore totally E501 with the solution found at this link. The solution was to edit the settings by ignoring totally the line length error:

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

However, it ignores completely the error. What I would like is to set E501 as a warning during the linting process.

starball
  • 20,030
  • 7
  • 43
  • 238
nemo
  • 58
  • 6

1 Answers1

0

From my very cursory understanding, I think you just can't. See also https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes. From how the "E" and "W" are baked into the code names, it seems to me like pycodestyle itself doesn't allow changing the levels of various problems. I suppose it wouldn't be impossible for something like this to be implemented at the VS Code Python extension level- to allow configuring translation of problem levels, but from what I see, the only thing you can do currently is to change the VS Code problem level of all pycodestyle errors/warnings to a specific VS Code problem level together- not at the granularity of individual pycodestyle errors/warnings- using something like: "python.linting.pycodestyleCategorySeverity.E": "Warning".

starball
  • 20,030
  • 7
  • 43
  • 238