We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b6803b commit 9e5b79aCopy full SHA for 9e5b79a
2 files changed
lua/guard-collection/formatter.lua
@@ -311,6 +311,12 @@ M.biome = {
311
stdin = true,
312
}
313
314
+M.buf = {
315
+ cmd = 'buf',
316
+ args = { 'format' },
317
+ stdin = true,
318
+}
319
+
320
M.xmllint = {
321
cmd = 'xmllint',
322
args = { '--format', '-' },
test/formatter/buf_spec.lua
@@ -0,0 +1,17 @@
1
+describe('buf', function()
2
+ it('can format', function()
3
+ local ft = require('guard.filetype')
4
+ ft('proto'):fmt('buf')
5
6
+ local formatted = require('test.formatter.helper').test_with('proto', {
7
+ [[syntax = "proto3"; message Foo { string bar = 1; }]],
8
+ })
9
+ assert.are.same({
10
+ [[syntax = "proto3";]],
11
+ [[]],
12
+ [[message Foo {]],
13
+ [[ string bar = 1;]],
14
+ [[}]],
15
+ }, formatted)
16
+ end)
17
+end)
0 commit comments