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

Add autopep8.enabled to the configuration schema #225

Merged
merged 1 commit into from
Jul 2, 2022

Conversation

j2kun
Copy link
Contributor

@j2kun j2kun commented Jun 23, 2022

Added a note that in order to enable yapf, one must disable autopep8.

Confirmed with the following config, which reports to the log which
formatter is being used when invoking
<cmd>lua vim.lsp.buf.formatting()<CR>

nvim_lsp.pylsp.setup {
  cmd = { "/.../bin/pylsp", "-v", "--log-file=/tmp/pylsp.log" },
  settings = {
    pylsp = {
      plugins = {
        autopep8 = {enabled = false},
      },
    },
  },
}

I only noticed this because my yapf config uses 2-space indenting
(thanks, Google, for forcing me to do this), and with no configuration
changes autopep8 will ignore that config in my setup.cfg and indent
with 4 spaces.

@ccordoba12 ccordoba12 added this to the v1.5.0 milestone Jun 23, 2022
@ccordoba12 ccordoba12 changed the title Add autopep8.enabled to the schema Add autopep8.enabled to the configuration schema Jun 23, 2022
@ccordoba12
Copy link
Member

Tests are failing due to a new Numpy release. I'll fix them in another PR.

@ccordoba12
Copy link
Member

Please rebase on top of the latest develop to get the fix to our tests in PR #231.

Added a note that in order to enable yapf, one must disable autopep8.

Confirmed with the following config, which reports to the log which
formatter is being used when invoking
`<cmd>lua vim.lsp.buf.formatting()<CR>`

```
nvim_lsp.pylsp.setup {
  cmd = { "/.../bin/pylsp", "-v", "--log-file=/tmp/pylsp.log" },
  settings = {
    pylsp = {
      plugins = {
        autopep8 = {enabled = false},
      },
    },
  },
}
```

I only noticed this because my yapf config uses 2-space indenting
(thanks, Google, for forcing me to do this), and with no configuration
changes it will ignore that config in my `setup.cfg`, because autopep8
doesn't see it.
@j2kun
Copy link
Contributor Author

j2kun commented Jul 2, 2022

@ccordoba12 done!

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @j2kun for your contribution!

@ccordoba12 ccordoba12 merged commit 9a2cacf into python-lsp:develop Jul 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants