Skip to content

Commit

Permalink
feat: add cbfmt (#198)
Browse files Browse the repository at this point in the history
* feat: add cbfmt

* lint: fix style

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
  • Loading branch information
guruor and stevearc committed Nov 15, 2023
1 parent ca3dfba commit aa36bc0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ You can view this list in vim with `:help conform-formatters`
- [blade-formatter](https://github.com/shufo/blade-formatter) - An opinionated blade template formatter for Laravel that respects readability.
- [blue](https://github.com/grantjenks/blue) - The slightly less uncompromising Python code formatter.
- [buf](https://buf.build/docs/reference/cli/buf/format) - A new way of working with Protocol Buffers.
- [cbfmt](https://github.com/lukas-reineke/cbfmt) - A tool to format codeblocks inside markdown and org documents.
- [clang_format](https://www.kernel.org/doc/html/latest/process/clang-format.html) - Tool to format C/C++/… code according to a set of rules and heuristics.
- [cljstyle](https://github.com/greglook/cljstyle) - Formatter for Clojure code.
- [cmake_format](https://github.com/cheshirekow/cmake_format) - Parse cmake listfiles and format them nicely.
Expand Down
15 changes: 15 additions & 0 deletions lua/conform/formatters/cbfmt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/lukas-reineke/cbfmt",
description = "A tool to format codeblocks inside markdown and org documents.",
},
command = "cbfmt",
args = { "--write", "--best-effort", "$FILENAME" },
cwd = util.root_file({
-- https://github.com/lukas-reineke/cbfmt#config
".cbfmt.toml",
}),
stdin = false,
}

0 comments on commit aa36bc0

Please sign in to comment.