Skip to content

Flake8 plugins issues #140

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

Closed
ivan94fi opened this issue Dec 22, 2021 · 3 comments · Fixed by #215
Closed

Flake8 plugins issues #140

ivan94fi opened this issue Dec 22, 2021 · 3 comments · Fixed by #215
Milestone

Comments

@ivan94fi
Copy link

Hi, currently there are two options for flake8 functionality:

  • the thid party plugin, pyls-flake8, which is recommended in the readme
  • the internal plugin, in pylsp/plugins/flake8_lint.py, which is not advertised in the documentation

I would like to report some issues with these plugins.

First issue: two functionally equivalent plugins (mostly)

The first issue I would like to point out is that the two plugins are equivalent: the internal one should be preferred, and the suggestion for the third party one removed.

Actually the pip version of the external plugin is buggy as it does not respect the boolean options passed to flake8's executable. I submitted a pull request to the repository to fix this issue and it was merged, but it is not published on pypi yet. Also, some functionality is missing with respect to the inner plugin, and overall it seems a bit more crude.

Second issue: flake8 support not explicitly stated in readme

While the "Configuration" section in the readme explains how to use configuration from flake8, the "Installation" section does not mention flake8 in the "list of optional providers that will be available (if the respective dependencies are found)". I think it should be explicitly stated, as at first it is not clear.

Third issue: flake8 vs pyflakes + pycodestyle + mccabe

As flake8 is a composition of pyflakes, pycodestyle and mccabe (plus various other flake8 plugins, if installed) I think it should be the default to disable the individual components if flake8 is run, as to avoid duplicated runtimes and reports. A simpler solution might be to advertise flake8 in the readme, as per the previous issue, and explicitly state something along the lines of "Flake8: linter to detect various errors (composition of pyflakes, pycodestyle and mccabe: use a combination of the components or flake8 alone to avoid duplicated error reports)."

This is an example of duplicated messages from pylsp, using atom client:

Click to view image

double_reports_pylsp

@ccordoba12
Copy link
Member

ccordoba12 commented Dec 23, 2021

Hey @ivan94fi, thanks for reporting. My comments:

Actually the pip version of the external plugin is buggy as it does not respect the boolean options passed to flake8's executable. I submitted a pull request to the repository to fix this issue and it was merged, but it is not published on pypi yet. Also, some functionality is missing with respect to the inner plugin, and overall it seems a bit more crude.

Ok, I didn't know that. Thanks for mentioning it.

I think it should be explicitly stated, as at first it is not clear.

I agree with this, given what you said about the external plugin.

As flake8 is a composition of pyflakes, pycodestyle and mccabe (plus various other flake8 plugins, if installed) I think it should be the default to disable the individual components if flake8 is run

I think this should be handled by clients and not here. It's fairly simple for clients to send a request to disable the other plugins when flake8 is enabled.

A simpler solution might be to advertise flake8 in the readme, as per the previous issue

Agreed.


Please submit a pull request with your suggested changes.

@michaelaye
Copy link

I think this should be handled by clients and not here. It's fairly simple for clients to send a request to disable the other plugins when flake8 is enabled.

I don't understand what this means? What constitutes a "client" of pylsp?

@ccordoba12
Copy link
Member

@michaelaye, the editors or IDEs that connect to this server, i.e. Neovim, Emacs, Sublime, Spyder, etc.

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

Successfully merging a pull request may close this issue.

3 participants