aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteven Arcangeli <506791+stevearc@users.noreply.github.com>2023-12-06 22:20:29 -0800
committerGitHub <noreply@github.com>2023-12-06 22:20:29 -0800
commit659838ff4244ef6af095395ce68aaaf99fa8e696 (patch)
treeb92754f2de1a225187769ed2c30e01a3ea703b3c /tests
parent8d0421a11b2944c6c059e0936a95182972921c30 (diff)
refactor!: formatter config functions take self as first argument (#233)
This is a breaking API change, but there is a shim in place that will keep existing functions working, just with a warning notification. Most people should not encounter this at all. For anyone overriding a formatter config value with a function that takes `(ctx)` as the parameter, it will need to be updated to take `(self, ctx)`.
Diffstat (limited to 'tests')
-rw-r--r--tests/runner_spec.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/runner_spec.lua b/tests/runner_spec.lua
index 020afac..c9cf75a 100644
--- a/tests/runner_spec.lua
+++ b/tests/runner_spec.lua
@@ -70,7 +70,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.are.same({ "echo", vim.api.nvim_buf_get_name(bufnr) }, cmd)
end)
@@ -84,7 +84,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.are.same({ "echo", vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) }, cmd)
end)
@@ -99,7 +99,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.are.same({ "echo", "--stdin" }, cmd)
end)
@@ -113,7 +113,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.equal("echo " .. vim.api.nvim_buf_get_name(bufnr) .. " | patch", cmd)
end)
@@ -127,7 +127,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.equal("echo " .. vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) .. " | patch", cmd)
end)
@@ -142,7 +142,7 @@ describe("runner", function()
}
local config = assert(conform.get_formatter_config("test"))
local ctx = runner.build_context(0, config)
- local cmd = runner.build_cmd(ctx, config)
+ local cmd = runner.build_cmd("", ctx, config)
assert.equal("echo | patch", cmd)
end)
end)