Skip to content

Commit 71f64fc

Browse files
committed
Add autopep8.enabled to the schema
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.
1 parent fa27a2b commit 71f64fc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CONFIGURATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This server can be configured using `workspace/didChangeConfiguration` method. E
44
| **Configuration Key** | **Type** | **Description** | **Default**
55
|----|----|----|----|
66
| `pylsp.configurationSources` | `array` of unique `string` (one of: `pycodestyle`, `pyflakes`) items | List of configuration sources to use. | `["pycodestyle"]` |
7+
| `pylsp.plugins.autopep8.enabled` | `boolean` | Enable or disable the plugin (disabling required to use `yapf`). | `true` |
78
| `pylsp.plugins.flake8.config` | `string` | Path to the config file that will be the authoritative config source. | `null` |
89
| `pylsp.plugins.flake8.enabled` | `boolean` | Enable or disable the plugin. | `false` |
910
| `pylsp.plugins.flake8.exclude` | `array` of `string` items | List of files or directories to exclude. | `[]` |

pylsp/config/schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
},
1515
"uniqueItems": true
1616
},
17+
"pylsp.plugins.autopep8.enabled": {
18+
"type": "boolean",
19+
"default": true,
20+
"description": "Enable or disable the plugin (disabling required to use `yapf`)."
21+
},
1722
"pylsp.plugins.flake8.config": {
1823
"type": ["string", "null"],
1924
"default": null,

0 commit comments

Comments
 (0)