Skip to content

flake8 process is causing very high CPU ussage #9852

@paw-lu

Description

@paw-lu

Environment data

  • VS Code version: 1.41.1
  • Extension version (available under the Extensions sidebar): 2020.1.58038
  • OS and version: macOS 10.14.4
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions:
    • flake8==3.7.9
    • flake8-bugbear==20.1.3
    • flake8-docstrings==1.5.0
    • flake8-isort==2.8.0
    • flake8-mypy==17.8.0
    • flake8-rst-docstrings==0.0.13
    • pyflakes==2.1.1
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Jedi

Expected behaviour

Linting will not cause CPU usage to spike

Actual behaviour

Process python -m flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s from VS code is using showing 100% CPU usage.

I see that this user was having the same issues, but created an issue in the wrong repo microsoft/vscode#88351

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

Currently opening any Python file causes this to occur. Closing the python files will not terminate the process. Only closing VS code will.

In settings "python.linting.flake8Enabled": true,.

The following is the used .flake8 file

[flake8]
ignore = E203, E266, E501, W503
max-line-length = 80
max-complexity = 18
docstring-convention = numpy
select = B,C,E,F,W,B9,D,RST

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Review> Validate state in progress
[Info] Review> Validating state...
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] Found GitHub remote
[Info] Found GitHub remote
[Info] Review> Queuing additional validate state
[Info] Review> no matching pull request metadata found for current branch plotting-stypes
[Info] Review> Validating state...
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] Found GitHub remote
[Info] Review> no matching pull request metadata found for current branch plotting-stypes

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

[Extension Host] Info Python Extension: 2020-01-31 09:43:27: > ~/Documents/pyfrb_projects/pyfrb/pyfrb_env/bin/python -m flake8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s ~/Documents/pyfrb_projects/pyfrb/pyfrb/__init__.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions