We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e5b79a commit a55f21bCopy full SHA for a55f21b
2 files changed
lua/guard-collection/formatter.lua
@@ -30,6 +30,12 @@ M.cbfmt = {
30
stdin = true,
31
}
32
33
+M['cmake-format'] = {
34
+ cmd = 'cmake-format',
35
+ args = { '-' },
36
+ stdin = true,
37
+}
38
+
39
M['clang-format'] = {
40
cmd = 'clang-format',
41
test/formatter/cmake-format_spec.lua
@@ -0,0 +1,17 @@
1
+describe('cmake-format', function()
2
+ it('can format', function()
3
+ local ft = require('guard.filetype')
4
+ ft('cmake'):fmt('cmake-format')
5
6
+ local formatted = require('test.formatter.helper').test_with('cmake', {
7
+ [[cmake_minimum_required(VERSION 3.10)]],
8
+ [[project(test)]],
9
+ [[add_executable(test main.cpp)]],
10
+ })
11
+ assert.are.same({
12
13
14
15
+ }, formatted)
16
+ end)
17
+end)
0 commit comments