Skip to content

Commit

Permalink
feat: zprint formatter for clojure (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffis authored Oct 17, 2023
1 parent 1281e26 commit 2800552
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ You can view this list in vim with `:help conform-formatters`
- [yamlfmt](https://github.com/google/yamlfmt) - yamlfmt is an extensible command line tool or library to format yaml files.
- [yapf](https://github.com/google/yapf) - Yet Another Python Formatter.
- [zigfmt](https://github.com/ziglang/zig) - Reformat Zig source into canonical form.
- [zprint](https://github.com/kkinnear/zprint) - Highly configurable formatter for Clojure and EDN.
<!-- /FORMATTERS -->

</details>
Expand Down
17 changes: 17 additions & 0 deletions lua/conform/formatters/zprint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/kkinnear/zprint",
description = "Formatter for Clojure and EDN.",
},
command = "zprint",
range_args = function(ctx)
return {
string.format(
"{:input {:range {:start %d :end %d :use-previous-!zprint? true :continue-after-!zprint-error? true}}}",
ctx.range.start[1] - 1,
ctx.range["end"][1] - 1
),
}
end,
}

0 comments on commit 2800552

Please sign in to comment.