Skip to content

Flake8 plugins issues #140

Closed
Closed

Description

@ivan94fi

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

Activity

  1. ccordoba12 commented on Dec 23, 2021

    @ccordoba12
    Member

    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.

  2. michaelaye commented on Mar 8, 2022

    @michaelaye

    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?

  3. ccordoba12 commented on Mar 8, 2022

    @ccordoba12
    Member

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

  4. added this to the v1.5.0 milestone on May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions