skip to Main Content

I have been using flake8 for linting but somehow it stopped showing me errors in the code in any of my workspaces (the squiggly underlines in the editor).

flake8 is installed in my conda environment.

Here is my settings.json:

{
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,

    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--max-line-length=80",
        "--docstring-convention=google",
        "--verbose"
    ]

}

When I run flake8 from the console, it does show me the errors.

I am using VS Code version 1.72.2 on Windows, and I installed flake8 version 5.0.4. Any idea what could be wrong with it?

2

Answers


  1. Open Command Palette and type in Linter. Select the option Python: Select Linter and it opens up all the available linters.
    In the drop down, select Flake8 and if required install it.

    That should work now!

    Login or Signup to reply.
  2. Just add to settings.json:

    "python.linting.flake8Path": "full_path_to_env/bin/flake8"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search