-
Notifications
You must be signed in to change notification settings - Fork 197
pylsp + ruff does not honor ~/.config/ruff/pyproject.toml, but ruff in isolation does #344
Replies: 3 comments · 13 replies
-
I see pylsp.plugins.ruff.lineLength now - is that the only way? |
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm also noticing pylsp.plugins.ruff.config - if this will respect ~/whatever, that'd be almost as good. |
Beta Was this translation helpful? Give feedback.
All reactions
-
@jhossbach, thought about this one? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hmm, I cannot reproduce this, can you post your version of |
Beta Was this translation helpful? Give feedback.
All reactions
-
Let's continue, if the offer still stands. I can see very clearly where errors are coming from using "folke/trouble.nvim". And you were absolutely right that I was getting warnings from pyflakes, not ruff. It seems that this works to turn off pyflakes, but not to turn on ruff:
And here's my /tmp/pylsp.log:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Does that mean you have two versions of ruff, one in Pyflakes is disabled per default when python-lsp-ruff is installed, when not stated otherwise in your config. Removing this line should thus not change anything. Assuming that you still have your custom ruff config in very_long_variable_name_that_does_not_respect_the_line_length_limit_provided_in_the_custom_config_pyproject_toml_file = 23 + 24 + 25 + 26 calling require('lspconfig').pylsp.setup({
-- For troubleshooting pylsp issues:
cmd = {"pylsp", "-vvv", "--log-file", "/tmp/pylsp.log"},
}) Remove the old |
Beta Was this translation helpful? Give feedback.
All reactions
-
I have just one ruff on my computer named tp-mini-c. I've been setting this up on multiple computers, hence the different paths to ruff. The version is 0.0.236 I set up the test.py you suggested, and got: ...and nothing more. When I use that config.lua and:
...then editing test.py gives the following in /tmp/pylsp.py:
Thanks! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Ah, I think I see the issue: When installing |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Yes, that helped. Thank you! |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Hi folks.
The subject line pretty much says it.
If I run ruff at the command line on a python file, I get warnings about lines of length > 132.
But if I use ruff off of pylsp, I get warnings for lines of length > 79.
My pyproject.toml looks like simply:
$ cat ~/.config/ruff/pyproject.toml
below cmd output started 2023 Tue Jan 24 06:03:03 PM PST
[tool.ruff]
line-length = 132
I believe I only have one ruff binary on my system. At least, I have only one on my $PATH.
What can I do to persuade pylsp to instruct ruff to use ruff's usual pyproject.toml search algorithm?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions