yazi: Assert plugin/flavor structure and warn about plugin/flavor suffix
- Always append suffix `.yazi` to plugin's and flavor's attribute names. - Warn if the attribute names already have the suffix. - Assert that plugin's and flavor's values point to directories containing an `init.lua` file.
This commit is contained in:
parent
09bc5c5949
commit
16f86c94ce
3 changed files with 66 additions and 43 deletions
0
tests/modules/programs/yazi/empty/.gitkeep
Normal file
0
tests/modules/programs/yazi/empty/.gitkeep
Normal file
|
|
@ -71,10 +71,21 @@
|
|||
};
|
||||
initLua = ./init.lua;
|
||||
plugins = {
|
||||
"test" = ./plugin;
|
||||
"another-test" = ./plugin;
|
||||
testplugin = ./plugin;
|
||||
## Produces warning
|
||||
#"plugin-with-suffix.yazi" = ./plugin;
|
||||
## Fails assertion
|
||||
#single-file-plugin = ./plugin/init.lua;
|
||||
#empty-dir-plugin = ./empty;
|
||||
};
|
||||
flavors = {
|
||||
testflavor = ./flavor;
|
||||
## Produces warning
|
||||
#"flavor-with-suffix.yazi" = ./flavor;
|
||||
## Fails assertion
|
||||
#single-file-flavor = ./flavor/init.lua;
|
||||
#empty-dir-flavor = ./empty;
|
||||
};
|
||||
flavors = { "test.yazi" = ./flavor; };
|
||||
};
|
||||
|
||||
test.stubs.yazi = { };
|
||||
|
|
@ -88,11 +99,9 @@
|
|||
${./theme-expected.toml}
|
||||
assertFileContent home-files/.config/yazi/init.lua \
|
||||
${./init.lua}
|
||||
assertFileContent home-files/.config/yazi/plugins/test.yazi/init.lua \
|
||||
assertFileContent home-files/.config/yazi/plugins/testplugin.yazi/init.lua \
|
||||
${./plugin/init.lua}
|
||||
assertFileContent home-files/.config/yazi/plugins/anotherTest.yazi/init.lua \
|
||||
${./plugin/init.lua}
|
||||
assertFileContent home-files/.config/yazi/flavors/test.yazi/init.lua \
|
||||
assertFileContent home-files/.config/yazi/flavors/testflavor.yazi/init.lua \
|
||||
${./flavor/init.lua}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue