Error on unrecognised configuration directive in .coveragerc

Issue #386 resolved
Kristian Glass
created an issue

I'd love it if coverage gave me an error if it encountered unrecognised directives in .coveragerc

Spot the problems with these files:

[run]
source = foo

[report]
branch = True

Did you notice that branch was in the report section when it should have been in run? You probably did, because you were deliberately looking for mistakes and it's a short file, but it's very easy to miss at a glance!

What about:

[report]
fail_under = 100

I cheated here. That's absolutely fine if you're using 4.0aSomething, but 3.7.1 doesn't support that directive (#314) which is entirely reasonable, but it's sure unpleasant to discover that you thought you were mandating 100% coverage but actually weren't...!

Some sort of "I don't know what to do with foo!" reporting, even if just a warning/informational message, would be incredibly useful please!

Comments (7)

  1. Kristian Glass reporter

    <3 thanks very much! :D

    Cheeky question - any feel for when there might be a definitive 4.x release? We've totally got stuff still on 3.7, and requires.io won't bump things until there's a stable version to bump to...

  2. Ned Batchelder repo owner

    Hmm, 4.0 is getting closer, but it has been a while. I would estimate a 4.0 final in perhaps two-month's time. requires.io doesn't like requirement specs like coverage>=4.0a6 ? Or direct bitbucket or github urls?

  3. Kristian Glass reporter

    Awesome thanks :)

    We have a policy of pinning test dependency versions, and requires.io won't prompt to upgrade existing projects with coverage==3.7.1 - we hand-update when we notice, but it's easy to miss!

  4. Log in to comment