python-lsp/python-lsp-server

How can I prevent autopep8 from changing tabsize to 4?

taiwbi opened this issue · 1 comments

This is my pylsp neovim configuration, It doesn't show E111 indentation is not a multiple of 4 anymore but when I format my document, it changes all the tabs from 2 spaces to 4 spaces

pylsp = {
  configurationSources = { "pycodestyle" },
  plugins = {
    autopep8 = {
      enabled = true,
      ignore = { "E121" },
      indentSize = 2,
    },
    pycodestyle = {
      enabled = true,
      maxLineLength = 121,
      indentSize = 2,
    },
  },
},

I just disabled autopep8 and started using yapf

pylsp = {
  configurationSources = { "pycodestyle" },
  plugins = {
    autopep8 = { enabled = false },
    yapf = {
      enabled = true,
      style = {
        based_on_style = "pep8",
        indent_width = 2,
      },
    },
    pycodestyle = {
      enabled = true,
      maxLineLength = 121,
      indentSize = 2,
    },
  },
},

I don't know if it's an issue or my configuration mistake so I keep this issue open but my problem is solved