You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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?
Activity
ccordoba12 commentedon Dec 23, 2021
Hey @ivan94fi, thanks for reporting. My comments:
Ok, I didn't know that. Thanks for mentioning it.
I agree with this, given what you said about the external plugin.
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.
Agreed.
Please submit a pull request with your suggested changes.
michaelaye commentedon Mar 8, 2022
I don't understand what this means? What constitutes a "client" of pylsp?
ccordoba12 commentedon Mar 8, 2022
@michaelaye, the editors or IDEs that connect to this server, i.e. Neovim, Emacs, Sublime, Spyder, etc.