sublimelsp / LSP-pylsp

Convenience package for the Python Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flake8 plugins are not operating

reagle opened this issue · comments

I'd like to use bugbear and a few other flake8 plugins within ST4 (4126) on macOS 12.4 21F79 arm64.

LSP, LSP-pylsp, and flake8 seem to be working, and I can get flake8 diagnostics (e.g., line too long) but they don't include plugin diagnostics. Do I need to do something to enable them in my LSP-pylsp.sublime-settings?

// Settings in here override those in "LSP-pylsp/LSP-pylsp.sublime-settings"

{
    "settings":
    {
        "pylsp.plugins.flake8.enabled": true,
        // "pylsp.plugins.flake8.maxLineLength": 88,
        "pylsp.plugins.flake8.perFileIgnores": 
        [
            "emit_biblatex.py:E203,E241,E701,E117,W503",
            "emit_yaml_csl.py:E203,E241,E701,E117,W503",
            "biblio_fields.py:E241"
        ],
        "pylsp.configurationSources": ["flake8"],
        // "pylsp.configurationSources": ["pycodestyle"],
        "pylsp.plugins.pycodestyle.enabled": false,
        "pylsp.plugins.mccabe.enabled": false,
        "pylsp.plugins.pyflakes.enabled": false,
        "pylsp.plugins.pyls_isort.enabled": true,
    }	
}

It might be that it would work to set pylsp.plugins.flake8.executable to your own installation of flake8 so that it can also find plugins in the same environment. By default it runs in a virtual environment managed by this package so likely it can't find any locally installed plugins.

You could also provide flake8 configuration to make it easy to reproduce if it still doesn't work.