-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should custom config override local pyproject.toml / ruff.toml? #91
Comments
|
Yes, thank you :) But more specifically, I am interested in the lspconfig.pylsp.setup({
settings = {
pylsp = {
plugins = {
ruff = {
enabled = true,
formatEnabled = true,
config = "~/.dotfiles/ruff.toml",
}
},
},
},
}) This makes any Python file use my standard Ruff config. But that also makes |
Interesting, the desired behavior should be to ignore the config setting if a local lspconfig.pylsp.setup({
settings = {
pylsp = {
plugins = {
ruff = {
enabled = true,
+ executable = {"<path-to-pylsp>", "-vvv", "--log-file", "/tmp/lsp.log"},
formatEnabled = true,
config = "~/.dotfiles/ruff.toml",
}
},
},
},
}) And then search for a line like "Found existing configuration for ruff, skipping pylsp config." in the logs? |
Had to put it like this: lspconfig.pylsp.setup({
cmd = {"<path-to-pylsp>", "-vvv", "--log-file", "/tmp/lsp.log"},
settings = {
pylsp = {
plugins = {
ruff = {
enabled = true,
formatEnabled = true,
config = "~/.dotfiles/ruff.toml",
}
},
},
},
}) Found something interesting: a local |
Hmm, can you post the full log? |
Here are all three possible states I tried: |
I took the liberty of removing the logs since your logs were showing the contents of the python file you were editing and I wasn't sure whether it contained sensitive information.
Adding a In short: This method does not work since python-lsp-ruff/pylsp_ruff/plugin.py Lines 718 to 720 in ba3c25f
|
Thank you! I made sure to remove anything sensitive, just wanted to test on a realistic file that made it easy to see what configuration is being applied. Yes, just tested that adding a blank |
Sorry for the late reply. Some IDEs always force you to work with a project, and in that case its path is |
Currently, when custom config is set during setup, project-local configuration files are ignored. I wonder whether this behavior is the result of an explicit design decision, or if it is open for discussion and subject to change. I imagined the setting to be a default config, used not to set the same settings across all projects, but to separate the configuration of LSP and Ruff and overridden by local settings.
The text was updated successfully, but these errors were encountered: