-
Notifications
You must be signed in to change notification settings - Fork 55
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
busted test stdlib extension is not working #91
Comments
Did you try this without the Also please update to v1.1.0 for bug reporting, I don't plan on doing patche releases against anything but the latest release series. |
It does work without It's not clear these two should interact in any way.
I do not see anything related in the changelog between 1.0.0 and 1.1.0 but I will try updating anyway. No difference with 1.1.0 |
If you explicitly specify a standard to use, it doesn't seem right that |
There is nothing about the global standard also overriding these default per-path overrides. In fact these starting with Also these defaults are pretty useless if selecting which interpreter you are targeting undoes them. |
Does it do the same thing clearing the defaults if you change the base |
No, setting the standard in That however means that that the std option behaves differently between commandline and config file. |
I for one would expect it to. I would expect the config file to integrate a bit more with defaults and the CLI options to clobber everything. I also wouldn't expect to have to specify all the possible options to get them all cleared on the CLI if I want to use a different std that the default. I could see making a case for the CLI just changing the same value as the config, but where would the option be to not have any file matching rules playing around with anything? |
That's because you are aware of implementation details of the tool and know it's difficult or even impossible to override the default path rules from the commandline, and that gives rise to a need to have an override. The problem here is that the override is implicit and undocumented rather than explicit. I cannot find any reference to this change of behavior of the std option between configuration file and commandline, neither in description of the std option nor in the description of the default path overrides. Ideally there should be a separate option for disabling the default path overrides, that's clear, transparent, and no less powerful. Nonetheless in the situation that the existing behavior is quirky and changing it could break stuff it would be nice to at least clearly document it. |
BTW can users use this +something syntax for their own path overrides? I can't find that documented anywhere either. |
Nevermind, the there is a notice about leading + in https://luacheck.readthedocs.io/en/stable/cli.html#sets-of-standard-globals |
Thanks for considering some improvements in this area. My suggestion would be to add commandline options like That way users can both opt in to the default overrides regardless of how they specify the standard globals as well as opt out of all the current and future overrides rather than overriding them one by one. I have no nice idea how to make the option reasonably short while it's also intelligible what it does. |
With luacheck 1.0.0 I get
luacheck --std min --config tests/lua/.luacheckrc --codes tests/lua/command_log_spec.lua
Checking tests/lua/command_log_spec.lua 31 warnings
tests/lua/command_log_spec.lua:3:1: (W113) accessing undefined variable describe
tests/lua/command_log_spec.lua:4:2: (W113) accessing undefined variable it
tests/lua/command_log_spec.lua:5:3: (W143) accessing undefined field has_no.error of global assert
tests/lua/command_log_spec.lua:6:3: (W143) accessing undefined field has_no.error of global assert
tests/lua/command_log_spec.lua:8:2: (W113) accessing undefined variable it
tests/lua/command_log_spec.lua:9:3: (W143) accessing undefined field has.error of global assert
tests/lua/command_log_spec.lua:10:3: (W143) accessing undefined field has.error of global assert
tests/lua/command_log_spec.lua:12:2: (W113) accessing undefined variable it
tests/lua/command_log_spec.lua:13:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:14:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:15:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:16:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:18:2: (W113) accessing undefined variable it
tests/lua/command_log_spec.lua:19:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:20:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:22:2: (W113) accessing undefined variable it
tests/lua/command_log_spec.lua:24:13: (W113) accessing undefined variable spy
tests/lua/command_log_spec.lua:25:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:26:3: (W143) accessing undefined field spy of global assert
tests/lua/command_log_spec.lua:26:33: (W113) accessing undefined variable match
tests/lua/command_log_spec.lua:28:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:29:3: (W143) accessing undefined field spy of global assert
tests/lua/command_log_spec.lua:29:33: (W113) accessing undefined variable match
tests/lua/command_log_spec.lua:31:3: (W143) accessing undefined field has.error of global assert
tests/lua/command_log_spec.lua:32:3: (W143) accessing undefined field spy of global assert
tests/lua/command_log_spec.lua:32:33: (W113) accessing undefined variable match
tests/lua/command_log_spec.lua:34:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:35:3: (W143) accessing undefined field spy of global assert
tests/lua/command_log_spec.lua:36:3: (W143) accessing undefined field equal of global assert
tests/lua/command_log_spec.lua:37:3: (W143) accessing undefined field spy of global assert
tests/lua/command_log_spec.lua:37:33: (W113) accessing undefined variable match
This is in conflict with what the documentation says:
files["/tests//*_spec.lua"].std = "+busted"
That is test files should recognize the busted test environment globals.
The text was updated successfully, but these errors were encountered: