Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bean-format fails to format a beancount file #309

Closed
John-Goff opened this issue Jul 14, 2024 · 2 comments · Fixed by #310
Closed

bean-format fails to format a beancount file #309

John-Goff opened this issue Jul 14, 2024 · 2 comments · Fixed by #310

Comments

@John-Goff
Copy link
Contributor

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: #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
Copy link
Member

raxod502 commented Oct 5, 2024

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.

raxod502 added a commit that referenced this issue Oct 5, 2024
Fixes #309

The `bean-format` tool reads a file from the filename passed on the
command line, then outputs the formatted file to `STDOUT`. The filename
passed on the command line is a requirement, the `bean-format` tool does
not read from `STDIN` at all. Another option would be to use
`("bean-format" input "-o" output)`, but this way apheleia can avoid an
extra file read that's not strictly necessary.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
@John-Goff
Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants