Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CLI flag to silence warnings from :cover module #239

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/excoveralls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ defmodule ExCoveralls do
@doc """
This method will be called from mix to trigger coverage analysis.
"""
def start(compile_path, _opts) do
Cover.compile(compile_path)
def start(compile_path, _) do
Cover.compile(compile_path, ConfServer.get()[:no_warn_cover])
fn() ->
execute(ConfServer.get, compile_path)
end
Expand Down
9 changes: 5 additions & 4 deletions lib/excoveralls/cover.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ defmodule ExCoveralls.Cover do
@doc """
Compile the beam files for coverage analysis.
"""
def compile(compile_path) do
:cover.stop
:cover.start
:cover.compile_beam_directory(compile_path |> string_to_charlist)
def compile(compile_path, quiet_cover \\ false) do
cover_module = if quiet_cover, do: :quiet_cover, else: :cover
cover_module.stop
cover_module.start
cover_module.compile_beam_directory(compile_path |> string_to_charlist)
end

@doc """
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule Mix.Tasks.Coveralls do
message: "Please specify 'test_coverage: [tool: ExCoveralls]' in the 'project' section of mix.exs"
end

switches = [filter: :string, umbrella: :boolean, verbose: :boolean, pro: :boolean, parallel: :boolean, sort: :string, output_dir: :string]
switches = [filter: :string, umbrella: :boolean, verbose: :boolean, pro: :boolean, parallel: :boolean, sort: :string, output_dir: :string, no_warn_cover: :boolean]
aliases = [f: :filter, u: :umbrella, v: :verbose, o: :output_dir]
{args, common_options} = parse_common_options(args, switches: switches, aliases: aliases)
all_options = options ++ common_options
Expand Down
Loading