Pylsp pylint configuration

I’m happily using the lsp for python and everything is working just fine. But I would like to configure pylint to use pyproject.toml from the git root directory. I’m struggeling to define a path that I can use in the configuration. Probably due to my limited lua knowledge.

lspconfig.pylsp.setup{
  on_attach = on_attach,
  capabilities = capabilities,
  settings = {
    formatCommand = {"black"},
    pylsp = {
      plugins = {
        pyls_flake8 = { enabled = false },
        pylint = { enabled = true,
                   args = { '--rcfile','~/path/to/my/git/root/pyproject.toml' }
        },
        black = { enabled = true },
        isort = { enabled = true },
        pyls_mypy = {
          enabled = true,
          --live_mode = true,
        },
      },
    }
  }
}
2 Likes