Skip to content

Commit 74ee5fc

Browse files
glehmannolivierh-propsafont
committed
doc: text editor/IDE configuration
Add the guidance on how to configure the text editor/IDE to get direct style/linter/type checker feedback while coding. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech> Co-authored-by: Olivier Hoareau <olivier.hoareau@vates.tech> Co-authored-by: Pau Ruiz Safont <psafont@users.noreply.github.com>
1 parent ade3c74 commit 74ee5fc

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,74 @@ ruff check lib/ tests/
366366
flake8
367367
```
368368

369-
The code checker diagnostics can also be shown directly in your IDE or text editor.
369+
The code checker diagnostics can also be shown directly in your IDE or text editor, by using plugins or language
370+
servers (LSP).
371+
372+
These configurations are provided as optional suggestions for convenience and do not imply official support or a
373+
requirement to use specific tools.
374+
375+
### [VSCodium](https://vscodium.com/)
376+
377+
A few plugins are recommended to properly report the diagnostics during the development:
378+
* [BasedPyright](https://open-vsx.org/extension/detachhead/basedpyright)
379+
* [flake8](https://open-vsx.org/extension/ms-python/flake8)
380+
* [ruff](https://open-vsx.org/extension/charliermarsh/ruff)
381+
382+
### [Helix](https://helix-editor.com/)
383+
384+
Install the required language servers:
385+
* [BasedPyright](https://docs.basedpyright.com/latest/) with `uv tool install basedpyright`
386+
* [pylsp](https://github.com/python-lsp/python-lsp-server) with `uv tool install python-lsp-server[flake8] --with pylsp-rope`.
387+
It's used to get immediate flake8 feedback in the text editor.
388+
389+
[ruff](https://docs.astral.sh/ruff/], which is also used as a language server, is already installed as a dev dependency.
390+
391+
Create a `.helix/language.toml` in the project. Make sure to exclude it in git,
392+
either in your user configuration (`~/.config/git/ignore`) or in the project
393+
configuration (`.git/info/exclude`).
394+
395+
~~~toml
396+
[[language]]
397+
name = "python"
398+
language-servers = [
399+
"basedpyright",
400+
"pylsp",
401+
"ruff",
402+
]
403+
auto-format = false
404+
405+
[language-server.basedpyright]
406+
environment = { "LANG" = "en" }
407+
config.basedpyright.analysis = { typeCheckingMode = "standard", diagnosticMode = "workspace" }
408+
409+
[language-server.pylsp.config.pylsp.plugins]
410+
autopep8.enabled = false
411+
flake8.enabled = true
412+
jedi.enabled = false
413+
mccabe.enabled = false
414+
preload.enabled = false
415+
pycodestyle.enabled = false
416+
pydocstyle.enabled = false
417+
pyflakes.enabled = false
418+
pylint.enabled = false
419+
yapf.enabled = false
420+
~~~
421+
422+
### Other LSP-Compatible Editors
423+
424+
Most modern editors use the Language Server Protocol (LSP) to enhance
425+
functionality. The following servers are generally suggested for this project:
426+
427+
* basedpyright: Real-time type checking ('uv tool install basedpyright').
428+
* pylsp: Coding style feedback via flake8 (`uv tool install "python-lsp-server[flake8]"`).
429+
* ruff: Immediate linting (included as a dev dependency).
430+
431+
Configuration is highly editor-specific; please consult your editor's
432+
documentation. Contributions to these docs via PR are always welcome!
433+
434+
### Others
435+
436+
Please add your configuration hints here!
370437

371438
## VM setup
372439
Many tests expect VMs with:

0 commit comments

Comments
 (0)