You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-7
Original file line number
Diff line number
Diff line change
@@ -59,19 +59,34 @@ Please file an issue if you require assistance writing a plugin.
59
59
60
60
## Configuration
61
61
62
-
Configuration is loaded from zero or more configuration sources. Currently implemented are:
62
+
Like all language servers, configuration can be passed from the client that talks to this server (i.e. your editor/IDE or other tool that has the same purpose). The details of how this is done depend on the editor or plugin that you are using to communicate with `python-lsp-server`. The configuration options available at that level are documented in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md).
63
63
64
-
- pycodestyle: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`.
65
-
- flake8: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg`
64
+
`python-lsp-server` depends on other tools, like flake8 and pycodestyle. These tools can be configured via settings passed from the client (as above), or alternatively from other configuration sources. The following sources are available:
66
65
67
-
The default configuration source is pycodestyle. Change the `pylsp.configurationSources` setting to `['flake8']` in order to respect flake8 configuration instead.
66
+
-`pycodestyle`: discovered in `~/.config/pycodestyle`, `setup.cfg`, `tox.ini` and `pycodestyle.cfg`.
67
+
-`flake8`: discovered in `~/.config/flake8`, `setup.cfg`, `tox.ini` and `flake8.cfg`
68
+
69
+
The default configuration source is `pycodestyle`. Change the `pylsp.configurationSources` setting (in the value passed in from your client) to `['flake8']` in order to use the flake8 configuration instead.
70
+
71
+
The configuration options available in these config files (`setup.cfg` etc) are documented in the relevant tools:
Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overridden by configuration discovered in the workspace.
70
77
71
-
To enable pydocstyle for linting docstrings add the following setting in your LSP configuration:
72
-
`"pylsp.plugins.pydocstyle.enabled": true`
78
+
As an example, to change the list of errors that pycodestyle will ignore, assuming you are using the `pycodestyle` configuration source (the default), you can:
79
+
80
+
1. Add the following to your ~/.config/pycodestyle:
81
+
82
+
```
83
+
[pycodestyle]
84
+
ignore = E226,E302,E41
85
+
```
86
+
87
+
2. Set the `pylsp.plugins.pycodestyle.ignore` config value from your editor
88
+
3. Same as 1, but add to `setup.cfg` file in the root of the project.
73
89
74
-
All configuration options are described in [`CONFIGURATION.md`](https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md).
0 commit comments