radian-software / apheleia

🌷 Run code formatter on buffer contents without moving point, using RCS patches and dynamic programming.
MIT License
523 stars 74 forks source link

Add support for `ruff format` for Python files #233

Closed offbyone closed 8 months ago

offbyone commented 9 months ago

The ruff linter has gained formatter support: https://github.com/astral-sh/ruff#usage

It's in beta, but it's mostly black-compatible, but much faster. I'd love it if Python formatting could use the "right" formatter depending on if black or ruff are installed.

I'm happy to submit a PR for this support.

raxod502 commented 9 months ago

Sure, that sounds fine to me. Let's keep black as the default for now, but add support for ruff so that users can set it to be used for Python if they prefer.

offbyone commented 8 months ago

I have opened a PR for this; I'm happy to add any changes you see fit, but it's at least passing checks :D