Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8.lintOnChange option not available #292

Closed
whitesnakeftw opened this issue Feb 20, 2024 · 2 comments · Fixed by #294
Closed

flake8.lintOnChange option not available #292

whitesnakeftw opened this issue Feb 20, 2024 · 2 comments · Fixed by #294
Assignees

Comments

@whitesnakeftw
Copy link

I'm using v2023.11.13551006 (pre-release). The flake8.lintOnChange option appears on the extension DETAILS tab, but it doesn't show in the FEATURE CONTRIBUTIONS tab or in @ext:ms-python.flake8. If I manually edit settings.json to add
"flake8.lintOnChange": true, it shows greyed out as well.

@khurd21
Copy link

khurd21 commented Feb 26, 2024

Hi,

I noticed this as well on: v2023.10.0

@karthiknadig
Copy link
Member

This is a mistake when writing the read me for this extension. We don't plan on adding lint on change. We tested this feature on pylint and seems like there is significant performance degradation to support this feature. We are reverting that feature on pylint as well.

The lint on change actually runs at your typing rate (i.e., every character you type) and flake8 is not performant enough to run per character. This can cause issues with the editor response time and user experience.

Alternatives:

  1. you can use auto-save and that will trigger linting at the auto save rate which is by default 1 second. In most cases the 1 second gap is enough for flake8 to run and respond.
  2. Ruff extension has support for this. ruff is significantly more performant and is able run fast enough that even if it runs on each character you type, it seems to be able to maintain a consistent user experience. ruff implements flake8 and pylint rules, and also supports several flake8 plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants