Skip to content

Commit

Permalink
Refactor minimum coverage check to be global rather than task specifi…
Browse files Browse the repository at this point in the history
…c based on `ensure_minimum_coverage` flag
  • Loading branch information
vereis committed Apr 19, 2023
1 parent 4dbe6ad commit c9e359b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
19 changes: 13 additions & 6 deletions lib/excoveralls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,19 @@ defmodule ExCoveralls do
Stats.report() |>
Enum.map(&Enum.into(&1, %{}))

if options[:umbrella] do
store_stats(stats, options, compile_path)
else
types = List.wrap(options[:type] || "local")
stats = Stats.update_paths(stats, options)
Enum.each(types, &analyze(stats, &1, options))
stats =
if options[:umbrella] do
store_stats(stats, options, compile_path)
stats
else
types = List.wrap(options[:type] || "local")
stats = Stats.update_paths(stats, options)
Enum.each(types, &analyze(stats, &1, options))
stats
end

if options[:enforce_minimum_coverage] do
Stats.ensure_minimum_coverage(stats)
end
after
if name = opts[:export] do
Expand Down
3 changes: 0 additions & 3 deletions lib/excoveralls/cobertura.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ defmodule ExCoveralls.Cobertura do
"""

alias ExCoveralls.Settings
alias ExCoveralls.Stats

@file_name "cobertura.xml"

Expand All @@ -17,8 +16,6 @@ defmodule ExCoveralls.Cobertura do
|> write_file(options[:output_dir])

ExCoveralls.Local.print_summary(stats)

Stats.ensure_minimum_coverage(stats)
end

defp generate_xml(stats, _options) do
Expand Down
2 changes: 0 additions & 2 deletions lib/excoveralls/html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ defmodule ExCoveralls.Html do
ExCoveralls.Local.print_summary(stats)

Stats.source(stats, options[:filter]) |> generate_report(options[:output_dir])

Stats.ensure_minimum_coverage(stats)
end

defp generate_report(map, output_dir) do
Expand Down
4 changes: 0 additions & 4 deletions lib/excoveralls/local.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ defmodule ExCoveralls.Local do
Locally displays the result to screen.
"""



defmodule Count do
@moduledoc """
Stores count information for calculating coverage values.
Expand All @@ -22,8 +20,6 @@ defmodule ExCoveralls.Local do
if options[:detail] == true do
source(stats, options[:filter]) |> IO.puts
end

ExCoveralls.Stats.ensure_minimum_coverage(stats)
end

@doc """
Expand Down

0 comments on commit c9e359b

Please sign in to comment.