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

Misc fixes #212

Closed mohkale closed 9 months ago

mohkale commented 10 months ago

Opening to remind myself to prioritise this:

  1. If a formatter is installed on a remote but not locally apheleia will skip formatting.
  2. jq formatter currently colorizes the output by default for me.
  3. clang-format uses buffer-file-name which doesn't respect remote file paths.
mohkale commented 10 months ago

Also, in general, I find tracing through apheleia code a little hard (given I wrote a lot of it that's not good :sweat_smile:). We should refactoring it a little here and their. Maybe decoupling the formatter running from the patch application to support plugging it into a library for example.

raxod502 commented 10 months ago

The structure isn't great, I agree. Most of that is my fault and I agree things need to change. I've got some work in progress for making it more testable (https://github.com/radian-software/apheleia/pull/204), and other refactoring is needed, as well.