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 ruby-syntax-tree format support #224

Closed strake7 closed 7 months ago

strake7 commented 9 months ago

Add ruby-syntax-tree as an available formatter. Include support for finding a .streerc file.

raxod502 commented 7 months ago

@strake7 How's the latest commit look to you? I refactored the existing apheleia-mix example into a reusable script, and adapted it for use here as well. It will automatically run stree from the same directory as .streerc if such a file exists. Then based on the documentation you linked I think it would load the file by default. If there is no such file it will just execute from the working directory.

strake7 commented 7 months ago

@strake7 How's the latest commit look to you? I refactored the existing apheleia-mix example into a reusable script, and adapted it for use here as well. It will automatically run stree from the same directory as .streerc if such a file exists. Then based on the documentation you linked I think it would load the file by default. If there is no such file it will just execute from the working directory.

This works great and is a far more desirable solution. Thank you @raxod502. Closing this PR

raxod502 commented 7 months ago

Er, well, I didn't merge anything, I just pushed to your PR branch.

strake7 commented 7 months ago

I mixed up my remotes then. @raxod502 An unused function, apheleia-formatters-args-from-file, made it in through. I removed it here - #273.