We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a99d710 commit fcd18b1Copy full SHA for fcd18b1
1 file changed
lua/conform/formatters/pruner.lua
@@ -0,0 +1,26 @@
1
+---@type conform.FileFormatterConfig
2
+return {
3
+ meta = {
4
+ url = "https://github.com/pruner-formatter/pruner",
5
+ description = "A language-agnostic, treesitter powered formatter.",
6
+ },
7
+ command = "pruner",
8
+ args = function(_, ctx)
9
+ local args = { "format" }
10
+
11
+ local textwidth = vim.api.nvim_get_option_value("textwidth", {
12
+ buf = ctx.buf,
13
+ })
14
+ if textwidth and textwidth > 0 then
15
+ table.insert(args, "--print-width=" .. textwidth)
16
+ end
17
18
+ local filetype = vim.api.nvim_get_option_value("filetype", {
19
20
21
+ table.insert(args, "--lang=" .. filetype)
22
23
+ return args
24
+ end,
25
+ stdin = true,
26
+}
0 commit comments