Skip to content

Commit

Permalink
Remove typical rails directories from filter_dir
Browse files Browse the repository at this point in the history
ignore_rel_paths are typical rails directories but thier name are general,
And they may contains normal ruby files. So use rel_path and vim.startswith.
  • Loading branch information
ippachi committed Nov 8, 2024
1 parent 5623b9a commit 62429a5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/neotest-minitest/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ end
---@param root string Root directory of project
---@return boolean
function NeotestAdapter.filter_dir(name, rel_path, root)
return name ~= "vendor"
local ignore_rel_paths = { "vendor/", "log/", "public/", "storage/", "tmp/" }
if name == "node_modules" then
return false
end

for _, ignore in ipairs(ignore_rel_paths) do
if vim.startswith(rel_path, ignore) then
return false
end
end

return true
end

---Given a file path, parse all the tests within it.
Expand Down

0 comments on commit 62429a5

Please sign in to comment.