-
-
Notifications
You must be signed in to change notification settings - Fork 360
modules/lua-loader: allow null value, do not configure by default #1906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/lua-loader: allow null value, do not configure by default #1906
Conversation
MattSturgeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good, I've commented on a few minor points we can discuss briefly, but I don't see any blockers that would prevent merging this as-is.
Thanks for the detailed description and justification, this is very helpful.
I completely agree that (where possible) we should try to produce empty output when the config is empty.
|
Your commit message could be improved by shortening the summary line and adding a "body" with some of your justification text? E.g. (Obviously that's just an example, word it as you please. Should probably try and wrap lines at 72 as per standard commit messages too.) |
9d7b727 to
a7008e4
Compare
MattSturgeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I can't see any issues.
Could you confirm you've checked the tests fail as expected when this isn't fixed? I'm not aware of any other tests that use the assertions option to do negative checks, so worth checking our tests implementation handles that correctly
Under the hood it completely fails evaluation. So this assertions fails even before the build starts. And yes, most of the time I test my test. It looks like this: At the end will be the full list of failed assertions (for one test only, not all). |
I think this is fine. I thought it'd be something along those lines. I guess I was worried about the eval failure causing other tests to not be run. Even if so, that's not the end of the world and could be improved separately.
Excellent 😁 |
MattSturgeon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Are you able to rebase on main? If not I can do a rebase merge on GitHub.
Ah, if that's the issue, I think it would be exactly the case, because current test framework runs all the tests in one evaluation. So this test will fail early, nothing else will be ran. And it's hard to tell what test is failed. Only assertion message is useful, even |
|
No, I was wrong. With full trace the test could be pin-pointed. Full trace, shown with Line |
This avoids having the option always "defined". This also avoids luaLoader configuration in extra files by default. Earlier `vim.loader.disable()` was always added to configs produced by `files` option, effectively disabling luaLoader even if it was explicitly enabled in a top-level configuration.
a7008e4 to
8eb5763
Compare
Done. |
I think #1898 will mitigate this slightly, but we can resolve it more fully in some future work. Thanks for your efforts! I'll try and look at your other PRs again soon, just currently a little busy. |
This changes
luaLoader.enableoption's type to allow null and sets its default to null.Why? First, most important: it's not expected to have vim.loader configuration in
filessubmodules. Changing default to null fixes that. Second, as I understand, the goal of this project is to not configure anything by default. I don't particularly like this extra line ininit.lua.My goal is to make
filessubmodules to produce empty configs by default. When I doI expect
ftplugin/nix.luawill have only this option, and nothing else.If somehow it's not desired, maybe a compromise can be made. Set it to
falsesomewhere in thetop-levelmodules, so that the default infilesstays null.Current behavior is completely undesired. Consider config:
With this config
init.luahasvim.loader.enable()andplugin/test.luahasvim.loader.disable()...