sublimelsp / LSP-pylsp

Convenience package for the Python Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flake8 config file rules are not applied on linting

AxZxP opened this issue · comments

commented

Issue:

  • tox.ini is not considered by flake8
  • pycodestyle is triggered despite the fact that I set its settings to false

I tried several methods but nothing works. A simple test with an E501 error because triggers:

   13:80  warning E501 line too long (80 > 79 characters) ​pycodestyle:E501
   13:80  warning E501 line too long (80 > 79 characters) ​flake8:E501

Despite the fact that my tox.ini is configured like this:

[flake8]
    ignore = E226,E302,E41
    max-line-length = 120

My ST project is configured as follows:

LSP Settings :

{
    "clients": {
        "pylsp": {
            "enabled": false,
            "selector": "source.python",
            "settings": {
                "pylsp.plugins.pyflakes.enabled": false, 
                "pylsp.plugins.pycodestyle.enabled": false, 
                "pylsp.plugins.flake8.enabled": true, 
                "pylsp.configurationSources": ["flake8"],
                "pylsp.plugins.jedi_rename.enabled": true,
                "pylsp.plugins.autopep8.enabled": false,  
                "pylsp.plugins.yapf.enabled": false,  
                "pylsp.plugins.black.enabled": true, 
                "pylsp.plugins.mypy_ls.enabled": true
}}}}

Py-lsp settings :

{
    "pylsp.plugins.mypy-ls.enabled": true,
    "pylsp.plugins.flake8.enabled": true,
    "pylsp.configurationSources": [ "flake8"],
    "pylsp.plugins.pyls_black.enabled": true,
    "pylsp.plugins.flake8.config": "~/.config/flake8/tox.ini"
}

Project settings

{
    "folders": [
        {
            "path": ".",
        },
    ],
    "settings": {
        "python_interpreter": "~/Library/Caches/pypoetry/virtualenvs/base-hkX03Jqr-py3.10/bin/python3",
        "LSP": {
            "pylsp": {
                "enabled": true,
                "command": [
                    "~/Library/Caches/pypoetry/virtualenvs/base-hkX03Jqr-py3.10/bin/pylsp",
                ],
                "settings": {
                    "pylsp.plugins.flake8.executable": "~/Library/Caches/pypoetry/virtualenvs/base-hkX03Jqr-py3.10/bin/flake8",
                },
            },
        },
    },
    "build_systems": [
        {
            "name": "Base Python Build",
            "cmd": [
                "~/Library/Caches/pypoetry/virtualenvs/base-hkX03Jqr-py3.10/bin/python3",
                "-u",
                "$file"
            ],
            "selector": "source.python",
            "file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)",
        }
    ],
}

All is working great, linting, mypy hints etc. but my linting prefs via flake8 config file is not impacting the error.
EDIT: with a minimal description of my python env managed by Poetry and with python-lsp-server[all], python-lsp-black, mypy-ls and pyls-isort added.