lunarmodules / luacov

LuaCov is a simple coverage analyzer for Lua code.
http://lunarmodules.github.io/luacov/
MIT License
300 stars 68 forks source link

feat(config): Use LUACOV_CONFIG as default_config_file #102

Closed broma0 closed 1 year ago

broma0 commented 1 year ago

On the command line, users can specify the configuration file like luacov -c config/luacov.lua.

When loading luacov like lua -l luacov program.lua, however, it seems like the config file is hardcoded to .luacov.

This PR changes the default luacov file to os.getenv("LUACOV_CONFIG") or ".luacov".

This is similar to luarocks, which has the LUAROCKS_CONFIG environment variable.

broma0 commented 1 year ago

@hishamhm - Please let me know if you'd like any changes on this

broma0 commented 1 year ago

@Tieske - I see that you're also part of the parent project, can you help review and potentially merge this one-liner?

Tieske commented 1 year ago

this would at least need a doc update here; https://github.com/lunarmodules/luacov#configuration and maybe some tests (if there are some around the config file, didn't check)

broma0 commented 1 year ago

Thanks @Tieske. I just updated the README and added tests.

Tieske commented 1 year ago

@broma0 the tests are failing on AppVeyor, can you fix them?

broma0 commented 1 year ago

@Tieske - Classic "works on my machine" situation due to windows/linux differences in setting environment variables. It works now!

broma0 commented 1 year ago

Hey @Tieske - please let me know if you'd like any more changes.

broma0 commented 1 year ago

@Tieske, @hishamhm - Following up after a few weeks - is there anything I can do to help release this? I'd like to use this repo instead of my fork as soon as possible.

Tieske commented 1 year ago

Thx @broma0 for your contribution!

broma0 commented 10 months ago

@Tieske / @hishamhm - Would you be able to publish this (and the other recent merges) to luarocks?