python-lsp/python-lsp-ruff

Allow disabling formatter

AtomToast opened this issue · 6 comments

As someone only needing the linting part of ruff, I'd like to be able to disable the formatter, which conflicts with the formatter I do use.

I spent the better part of the day trying to figure out why black always broke the formatting when running inside of my editor but not when running from our pre-commit hook or manually in the terminal... Now I finally figured out that it was actually this plugin having formatting enabled by default.
Ruff formatting is not 100% compatible with black, which basically stops me from using this plugin entirely in my workflow. Which sucks because I do actually want the linting part of ruff.

Otherwise I guess I'll need to setup another language server for which I can then entirely disable document formatting

Looking into it.

Can you checkout https://github.com/python-lsp/python-lsp-ruff/tree/fix_%2383 and see if that resolves your issue? I tried locally with neovim and it seems to work.

That resolves it for me 👍

Any chance of getting this into a pr?

Certainly, but I want to check if returning None is valid as a formatting response before merging.