parroty / excoveralls

Coverage report tool for Elixir with coveralls.io integration.
MIT License
820 stars 178 forks source link

Allow per-file minimum coverage #304

Open vereis opened 1 year ago

vereis commented 1 year ago

Ahoy!!

This PR allows you to have per-file minimum coverage when you have coverage options that looks like:

{
  "coverage_options": {
    "minimum_coverage": 80,
    "minimum_file_coverage": {
      "lib/my_app/example.ex": 100
    }
  }
}

If any files don't meet the configured threshold, then you'll get an error as follows:

FAILED: Expected minimum coverage of 100% for `lib/my_app/billing/example.ex`, got 16.7%.

This should also close #130

WDYT @parroty?

vereis commented 1 year ago

Additionally, I think I'd like to implement an optional flag which enables mix coveralls.json to fail with this minimum coverage setting too; something like mix coveralls.json --enable-minimum-coverage or something similar.

Do you have any strong opinions re: this before I spike it out?

Should additionally close #297

Ended up making #305 anyway

vereis commented 1 year ago

@parroty ahoy! Any remaining thoughts on this PR? Happy to keep iterating on it if you think there is anything missing?