Add bean-format (#101)

* feat: add bean-format

* fix: apt => apt-get

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>

* fix: pip => pip3

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>

* Update changelog

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
This commit is contained in:
Ellis Kenyő 2022-06-20 22:51:17 +01:00 committed by GitHub
parent 2fa9dd97ed
commit ac6f733d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 2 deletions

View file

@ -8,9 +8,12 @@ The format is based on [Keep a Changelog].
* shfmt uses 4 spaces instead of tabs by default.
### Formatters
* [bean-format](https://github.com/beancount/beancount) for Beancount
([#101]).
* [stylua](https://github.com/JohnnyMorganz/StyLua) for Lua ([#105]).
[#105]: https://github.com/raxod502/apheleia/pull/105
[#101]: https://github.com/radian-software/apheleia/pull/101
[#105]: https://github.com/radian-software/apheleia/pull/105
## 3.0 (released 2022-06-01)
### Breaking changes

View file

@ -919,7 +919,8 @@ being run, for diagnostic purposes."
(apply-partially #'kill-buffer scratch)))))
(defcustom apheleia-formatters
'((black . ("black" "-"))
'((bean-format . ("bean-format" filepath))
(black . ("black" "-"))
(brittany . ("brittany"))
(clang-format . ("clang-format"))
(dart-format . ("dart" "format"))
@ -1047,6 +1048,7 @@ function: %s" command)))
(defcustom apheleia-mode-alist
'(;; php-mode has to come before cc-mode
(php-mode . phpcs)
(beancount-mode . bean-format)
(cc-mode . clang-format)
(c-mode . clang-format)
(c++-mode . clang-format)

View file

@ -0,0 +1,2 @@
apt-get install -y python3-pip
pip3 install beancount

View file

@ -0,0 +1,11 @@
* Section header
;; Accounts (comments)
2013-01-01 open Expenses:Restaurant
2013-01-01 open Assets:Cash
2014-03-02 * "Something"
Expenses:Restaurant 50.02 USD
Assets:Cash
2014-03-05 balance Assets:Cash -50.02 USD
2014-03-10 * "Something"
Assets:Other 10 HOOL {500.23} USD ; Bla
Assets:Cash

View file

@ -0,0 +1,11 @@
* Section header
;; Accounts (comments)
2013-01-01 open Expenses:Restaurant
2013-01-01 open Assets:Cash
2014-03-02 * "Something"
Expenses:Restaurant 50.02 USD
Assets:Cash
2014-03-05 balance Assets:Cash -50.02 USD
2014-03-10 * "Something"
Assets:Other 10 HOOL {500.23} USD ; Bla
Assets:Cash