Skip to content

Commit

Permalink
feat: add beancount formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
varac committed Nov 21, 2023
1 parent 2e5866a commit 3622fc9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ You can view this list in vim with `:help conform-formatters`
- [auto_optional](https://auto-optional.daanluttik.nl/) - Adds the Optional type-hint to arguments where the default value is None.
- [autoflake](https://github.com/PyCQA/autoflake) - Removes unused imports and unused variables as reported by pyflakes.
- [autopep8](https://github.com/hhatto/autopep8) - A tool that automatically formats Python code to conform to the PEP 8 style guide.
- [bean-format](https://beancount.github.io/docs/running_beancount_and_generating_reports.html#bean-format) - Format [Beancount](https://beancount.github.io/) files.
- [beautysh](https://github.com/lovesegfault/beautysh) - A Bash beautifier for the masses.
- [bibtex-tidy](https://github.com/FlamingTempura/bibtex-tidy) - Cleaner and Formatter for BibTeX files.
- [biome](https://github.com/biomejs/biome) - A toolchain for web projects, aimed to provide functionalities to maintain them.
Expand Down Expand Up @@ -515,7 +516,6 @@ Retrieve the available formatters for a buffer
`list_all_formatters(): conform.FormatterInfo[]` \
List information about all filetype-configured formatters


### get_formatter_info(formatter, bufnr)

`get_formatter_info(formatter, bufnr): conform.FormatterInfo` \
Expand All @@ -534,6 +534,7 @@ Check if the buffer will use LSP formatting when lsp_fallback = true
| Param | Type | Desc |
| ------- | ------------ | ------------------------------------ |
| options | `nil\|table` | Options passed to vim.lsp.buf.format |

<!-- /API -->

## Acknowledgements
Expand Down
12 changes: 12 additions & 0 deletions lua/conform/formatters/bean-format.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://beancount.github.io/docs/running_beancount_and_generating_reports.html#bean-format",
description = "Reformat Beancount files to right-align all the numbers at the same, minimal column.",
},
command = "bean-format",
args = {
"-",
},
}

0 comments on commit 3622fc9

Please sign in to comment.