Conversation
Uses the default configuration, with some small tweaks.
The lsp dependency installs the python-lsp-server via pip, as well as some useful extensions. Adding this dep. to the dev opt. dep. now installs a working lsp in the dev nox environment.
|
@namcsi, I would like not to add editor specific configs to the template. Everyone uses a different one. For example, my editor does not use any of these lsp's but uses pyright out of the box. I am also not a fan of a zoo of separate configs. This just confuses users starting with the template. These days, a lot of tools can be configured directly in pyproject.toml. So I would actually suggest to ditch all those separate configs and consolidate in pyproject.toml. On another note, I recently ditched all linters in my python projects in favor of ruff, which supports black-like formatting/import sorting/linting. So my suggestion would be to rather simplify the config to just use ruff+mypy. If you use a ruff and mypy based lsps, you should hopefully get the configuration from the pyproject.toml file out of the box. This should cover the important bits for configuration. Modern editors should just provide working auto-completion out of the box. |
|
Fair enough, if we want to keep the project template LSP agnostic then this addition is not helpful. The LSP client config (found in the commited As to ruff, I have been meaning to use it since I have read nice things, and I agree it would help consolidate the various linting tools we have, so I would love that personally. |
This PR adds a lsp optional dependency (that is also included in the dev optional dependency) which installs the python-lsp-sever along with the extra plugings for the tools used by the project template.
This will allow users of the template to simply run
nox -s devand and activate their nox dev virtual environment (perhaps via direnv) to have a full python LSP available for them in their PATH for their editor to talk to.I also added a
.dir-locals.elto configure the python-lsp-server and it's plugins for the emacs eglot LSP client by default.