radian-software / apheleia

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

Add support for `treefmt` #280

Closed terlar closed 6 months ago

terlar commented 6 months ago

This formatter is formatting via treefmt. This is useful if the project is configuring formatters for the project and you don't have to replicate this logic within Emacs, but instead utilize treefmt directly.

To do that you can set the apheleia-formatter to treefmt within the projects .dir-locals.el.

I noticed there are tests for this, since treefmt could technically format anything, I went with treefmt formatting rust code. It also relies on having a treefmt.toml in the project folder, so had to add that as well in the tests.