Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I prevent autopep8 from changing tabsize to 4? #521

Open
taiwbi opened this issue Jan 25, 2024 · 1 comment
Open

How can I prevent autopep8 from changing tabsize to 4? #521

taiwbi opened this issue Jan 25, 2024 · 1 comment

Comments

@taiwbi
Copy link

taiwbi commented Jan 25, 2024

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,
    },
  },
},
@taiwbi
Copy link
Author

taiwbi commented Jan 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant