Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all: format lint test

test:
/usr/bin/nvim --headless -u scripts/minimal-for-lazy.lua -c "PlenaryBustedDirectory lua/spec { minimal_init='./scripts/minimal-for-lazy.lua', sequential=true, }"


lint:
luacheck lua

format:
stylua lua

46 changes: 46 additions & 0 deletions scripts/minimal-for-lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- this file create separate XDG path
-- thus Lazy.nvim doesnt takes control over the loading
local M = {}

function M.root(root)
local f = debug.getinfo(1, "S").source:sub(2)
return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (root or "")
end

---@param plugin string
function M.load(plugin)
local name = plugin:match(".*/(.*)")
local package_root = M.root(".tests/site/pack/deps/start/")
if not vim.loop.fs_stat(package_root .. name) then
print("Installing " .. plugin)
vim.fn.mkdir(package_root, "p")
vim.fn.system({
"git",
"clone",
"--depth=1",
"https://github.com/" .. plugin .. ".git",
package_root .. "/" .. name,
})
end
end

function M.setup()
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append(M.root())
vim.opt.packpath = { M.root(".tests/site") }

M.load("nvim-lua/plenary.nvim")
M.load("nvim-neotest/nvim-nio")
M.load("nvim-treesitter/nvim-treesitter")
M.load("nvim-neotest/neotest")
M.load("neovim/nvim-lspconfig")
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
--
sync_install = true,
ensure_installed = { "go" },
auto_install = true,
})
end

M.setup()