How to format Python code with Ruff (how to use ruff as a formatter)? #633
-
I want to use Ruff to auto-format the code on save. The same as Black is used to auto-format Python code on save. Can I just call a custom command (e.g. There is a ready to use setup https://github.com/AstroNvim/astrocommunity/tree/0ac1d3770506b9b7f7c5d420eed5f69cd1c8b5a5/lua/astrocommunity/pack/python-ruff but one of purposes of Ruff is to replace Black formatter. Sadly, I was not able to find neither examples, nor instructions. Also, the official Ruff page https://docs.astral.sh/ruff/integrations/ is not clear too about using Ruff as a formatter. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved by installing |
Beta Was this translation helpful? Give feedback.
Solved by installing
ruff-lsp
via Mason.