Automated dev commit
This commit is contained in:
parent
7f451136fc
commit
fe5c8259c8
3 changed files with 27 additions and 24 deletions
|
@ -1,63 +1,57 @@
|
||||||
{
|
{
|
||||||
flake.modules.nixvim.custom.extraConfigLua = ''
|
flake.modules.nixvim.custom.extraConfigLua = ''
|
||||||
vim.fn["edit_alternate#rule#add"]("go", function(filename)
|
vim.fn["edit_alternate#rule#add"]("go", function(filename)
|
||||||
if filename:find "_test%.go$" then
|
return filename:find "_test%.go$"
|
||||||
return filename:gsub("_test%.go$", ".go")
|
and filename:gsub("_test%.go$", ".go")
|
||||||
else
|
or filename:gsub("%.go$", "_test.go")
|
||||||
return filename:gsub("%.go$", "_test.go")
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.fn["edit_alternate#rule#add"]("php", function(filename)
|
vim.fn["edit_alternate#rule#add"]("php", function(filename)
|
||||||
if filename:find "Test.php$" then
|
if filename:find "Test.php$" then
|
||||||
filename = filename:gsub("Test.php$", ".php")
|
filename = filename:gsub("Test.php$", ".php")
|
||||||
|
|
||||||
if filename:find "tests/src/" then
|
return filename:find "tests/src/"
|
||||||
-- Drupal tests. Remove the `src/{type}` from the path.
|
and filename:gsub("tests/src/(.-)/", "src/")
|
||||||
return filename:gsub("tests/src/(.-)/", "src/")
|
or filename:gsub("tests/", "src/")
|
||||||
else
|
else
|
||||||
return filename:gsub("tests/", "src/")
|
test_filename = filename:gsub(".php$", "Test.php")
|
||||||
end
|
|
||||||
else
|
|
||||||
filename = filename:gsub(".php$", "Test.php")
|
|
||||||
|
|
||||||
if filename:find "modules/custom" then
|
if test_filename:find "modules/custom" then
|
||||||
-- Drupal test types.
|
|
||||||
local test_types = { "Functional", "FunctionalJavaScript", "Kernel", "Unit" }
|
local test_types = { "Functional", "FunctionalJavaScript", "Kernel", "Unit" }
|
||||||
|
|
||||||
for _, test_type in ipairs(test_types) do
|
for _, test_type in ipairs(test_types) do
|
||||||
local filename_with_test_type = filename:gsub("src/", string.format("tests/src/%s/", test_type))
|
local candidate = test_filename:gsub("src/", string.format("tests/src/%s/", test_type))
|
||||||
|
|
||||||
-- Return the first matching test file that exists.
|
if vim.fn.filereadable(candidate) == 1 then
|
||||||
if vim.fn.filereadable(filename_with_test_type) == 1 then
|
return candidate
|
||||||
return filename_with_test_type
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return test_filename
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if vim.fn.filereadable "composer.json" == 1 then
|
if vim.fn.filereadable "composer.json" == 1 then
|
||||||
vim.fn["edit_alternate#rule#add"]("json", function(filename)
|
vim.fn["edit_alternate#rule#add"]("json", function(filename)
|
||||||
if filename:find "composer.json" then
|
if filename:find "composer.json" and filename:gsub("%.json$", ".lock") or nil
|
||||||
return (filename:gsub("%.json$", ".lock"))
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.fn["edit_alternate#rule#add"]("lock", function(filename)
|
vim.fn["edit_alternate#rule#add"]("lock", function(filename)
|
||||||
if filename:find "composer.lock" then
|
if filename:find "composer.lock" then
|
||||||
return (filename:gsub("%.lock$", ".json"))
|
return filename:gsub("%.lock$", ".json")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.filereadable "fractal.config.js" == 1 then
|
if vim.fn.filereadable "fractal.config.js" == 1 then
|
||||||
vim.fn["edit_alternate#rule#add"]("twig", function(filename)
|
vim.fn["edit_alternate#rule#add"]("twig", function(filename)
|
||||||
return (filename:gsub("%.twig$", ".config.yml"))
|
return filename:gsub("%.twig$", ".config.yml")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.fn["edit_alternate#rule#add"]("yml", function(filename)
|
vim.fn["edit_alternate#rule#add"]("yml", function(filename)
|
||||||
return (filename:gsub("%.config.yml$", ".twig"))
|
return filename:gsub("%.config.yml$", ".twig")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
11
todo.txt
11
todo.txt
|
@ -1 +1,10 @@
|
||||||
Re-configure diagnostic output in neovim.
|
Configure external hard drives on nixedo.
|
||||||
|
|
||||||
|
server:
|
||||||
|
jellyfin
|
||||||
|
immich
|
||||||
|
tubearchivist
|
||||||
|
websites
|
||||||
|
forgejo
|
||||||
|
|
||||||
|
Create a Home Manager module for bluetuith.
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.8 MiB |
Loading…
Add table
Add a link
Reference in a new issue