Skip to content

Commit

Permalink
[#309] Write beancount files to disk before formatting (#310)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John-Goff and raxod502 authored Oct 5, 2024
1 parent 302a41c commit 307afa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ The format is based on [Keep a Changelog].
* `mix format` is now passed the `--stdin-filename` argument which is
required in some cases. The version of Mix is autodetected and this
option is only passed when it is supported ([#319]).
* Beancount files are formatted without an error ([#309]).

## Internal
* Improvements to formatter test framework, it is now possible to
write tests that have additional data files ([#301]).

[#301]: https://github.com/radian-software/apheleia/pull/301
[#306]: https://github.com/radian-software/apheleia/pull/306
[#309]: https://github.com/radian-software/apheleia/issues/309
[#312]: https://github.com/radian-software/apheleia/issues/312
[#313]: https://github.com/radian-software/apheleia/pull/313
[#316]: https://github.com/radian-software/apheleia/pull/316
Expand Down
2 changes: 1 addition & 1 deletion apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'((astyle . ("astyle" (apheleia-formatters-locate-file
"--options" ".astylerc")))
(asmfmt . ("asmfmt"))
(bean-format . ("bean-format"))
(bean-format . ("bean-format" input))
(beautysh . ("beautysh"
(apheleia-formatters-indent
"--tab" "--indent-size" 'sh-basic-offset)
Expand Down

0 comments on commit 307afa9

Please sign in to comment.