lunarmodules / luacov

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

Comment to skip coverage per block or line #54

Closed LPGhatguy closed 6 years ago

LPGhatguy commented 7 years ago

Sometimes I have branches that I don't really care about coverage for, but having a bright red mark on the line/file in Coveralls is a shame.

A feature to have inline configuration comments would be useful, like:

-- luacov: disable block
if DEBUG_SETTING_ONLY then
    -- I don't care if this code is covered by tests, it's for specific circumstances!
    print("Debug mode enabled!")
end

If block parsing is too difficult in the context of luacov (and I imagine it is), this would be pretty handy:

if DEBUG_SETTING_ONLY then
    -- luacov: disable
    -- debug stuff here
    -- luacov: enable
end
mpeterv commented 6 years ago

A bit late, but I've implemented the second variation on master branch. Parsing blocks is indeed difficult in luacov, would need to import a full lexer/parser. Luacov does some limited lexing that allows it to figure out comments like that.

A new version with this feature will be released soon, within a week most likely.

LPGhatguy commented 6 years ago

Is there a succinct change log for 0.13 available anywhere?

mpeterv commented 6 years ago

@LPGhatguy it's in the documentation, doc/index.html, or run luarocks doc luacov if you have the new version installed. I forgot to push the new documentation to github pages, will fix.