Skip to content

Commit 66b9207

Browse files
committed
chore: formatting
1 parent e6f0811 commit 66b9207

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

lua/neotest-phpunit/init.lua

+27-17
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ local dap_configuration
1313
local function get_strategy_config(strategy, program, args)
1414
local cfg = {
1515
dap = function()
16-
vim.validate({ dap = {
17-
dap_configuration,
18-
function (val)
19-
local valid = type(val) == "table" and not vim.tbl_isempty(val)
20-
21-
return valid, "Configure `dap` field (like in dap.configurations.php) before using this strategy"
22-
end,
23-
"not empty table"
24-
}})
16+
vim.validate({
17+
dap = {
18+
dap_configuration,
19+
function(val)
20+
local valid = type(val) == "table" and not vim.tbl_isempty(val)
21+
22+
return valid, "Configure `dap` field (like in dap.configurations.php) before using this strategy"
23+
end,
24+
"not empty table",
25+
},
26+
})
2527
vim.validate({
2628
phpunit_cmd = {
2729
program,
28-
function (val)
30+
function(val)
2931
return type(val) == "string", "For `dap` strategy `phpunit_cmd` must be (or return) string."
3032
end,
3133
"string",
32-
}
34+
},
3335
})
3436

3537
return vim.tbl_extend("keep", {
@@ -61,12 +63,16 @@ function NeotestAdapter.root(dir)
6163

6264
for _, root_ignore_file in ipairs(config.get_root_ignore_files()) do
6365
result = lib.files.match_root_pattern(root_ignore_file)(dir)
64-
if result then return nil end
66+
if result then
67+
return nil
68+
end
6569
end
6670

6771
for _, root_file in ipairs(config.get_root_files()) do
6872
result = lib.files.match_root_pattern(root_file)(dir)
69-
if result then break end
73+
if result then
74+
break
75+
end
7076
end
7177

7278
return result
@@ -85,7 +91,9 @@ end
8591
---@return boolean
8692
function NeotestAdapter.filter_dir(name)
8793
for _, filter_dir in ipairs(config.get_filter_dirs()) do
88-
if name == filter_dir then return false end
94+
if name == filter_dir then
95+
return false
96+
end
8997
end
9098

9199
return true
@@ -121,7 +129,6 @@ function NeotestAdapter.discover_positions(path)
121129
})
122130
end
123131

124-
125132
---@param args neotest.RunArgs
126133
---@return neotest.RunSpec | nil
127134
function NeotestAdapter.build_spec(args)
@@ -137,7 +144,7 @@ function NeotestAdapter.build_spec(args)
137144
if position.type == "test" then
138145
local filter_args = vim.tbl_flatten({
139146
"--filter",
140-
'::' .. position.name .. '( with data set .*)?$',
147+
"::" .. position.name .. "( with data set .*)?$",
141148
})
142149

143150
logger.info("position.path:", { position.path })
@@ -154,6 +161,8 @@ function NeotestAdapter.build_spec(args)
154161
script_args,
155162
})
156163

164+
logger.trace("PHPUnit command: ", { command })
165+
157166
---@type neotest.RunSpec
158167
return {
159168
command = command,
@@ -191,6 +200,7 @@ function NeotestAdapter.results(test, result, tree)
191200
return {}
192201
end
193202

203+
logger.trace("Results:", results)
194204
return results
195205
end
196206

@@ -231,7 +241,7 @@ setmetatable(NeotestAdapter, {
231241
if is_callable(opts.env) then
232242
config.get_env = opts.env
233243
elseif type(opts.env) == "table" then
234-
config.get_env = function ()
244+
config.get_env = function()
235245
return opts.env
236246
end
237247
end

0 commit comments

Comments
 (0)