J4D3V · 2022-10-21 23:00
I'm currently using lsp-mode with [python-lsp-server](https://github.com/python-lsp/python-lsp-server/) and everything was working correctly until now, I started working on another project which does not use the same tools as the other projects.
Is there any way to adjust the lsp-mode [configurations](https://emacs-lsp.github.io/lsp-mode/page/lsp-pylsp/#available-configurations) dynamically per project, something like .flake8 or tox.ini?
Drfiresign · 2022-10-22 02:19
Take a look at the manual for [directory local variables](https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html). You can set whatever Emacs variables to values that only apply in that specific directory and all of its subdirectories.
holyfudge · 2022-10-22 06:16
Maybe direnv could be a solution?
yyoncho · 2022-10-22 12:50
You can use dir locals as suggested by others. I believe that this particular server supports putting configuration file in the root of the project but you should refer to their docs/ask them.
J4D3V · 2022-10-22 14:52
Thanks, I think I'll use this with dir-local-env. (Although I was looking for something that could be sent to git and was compatible between editors, but I think those are limitations of LSP).
starenka · 2022-10-22 17:17
i disabled lsp-diagnostics and just use flycheck "by myself". you can set checker chain (f.e flake8 and pylint) via dir local vars then and those tools obey conf/rc files stored in project root (which you can commit and share with others)