radian-software / apheleia

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

`bean-format` fails to format a beancount file #309

Closed John-Goff closed 1 week ago

John-Goff commented 3 months ago

Given the file in.beancount found here: https://github.com/radian-software/apheleia/blob/main/test/formatters/samplecode/bean-format/in.beancount

apheleia-format-buffer and other formatting commands fail, with the following contents in the *apheleia-bean-format-log* buffer

Sun Jul 14 12:58:09 2024 :: /Users/johngoff/Dropbox/Notes/
$ bean-format

Usage: bean-format [OPTIONS] FILENAME
Try 'bean-format --help' for help.

Error: Missing argument 'FILENAME'.

Command failed with exit code 2.

Seems as though this has been broken for over 2 years, as the most recent change to that formatter was this one: https://github.com/radian-software/apheleia/pull/110. I have been using apheleia through Doom Emacs, which must have updated the pinned version of apheleia recently which is why I didn't notice this sooner.

raxod502 commented 1 week ago

Seems more likely to me that this has either always been broken, or the older version of beancount that was current when this formatter was added used to allow reading from stdin. But I have not investigated.

John-Goff commented 1 week ago

Yeah you're right, I learned since opening this PR that beancount released a new major version at some point before when I noticed this. Either way, thanks for merging that fix!