Skip to content

Commit

Permalink
remove deprecations and depwarns
Browse files Browse the repository at this point in the history
Probably been long enough.
  • Loading branch information
vtjnash committed Nov 17, 2020
1 parent 36fc28a commit 0212b76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
20 changes: 3 additions & 17 deletions src/codecovio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Codecov
using JSON
using LibGit2

export submit, submit_token, submit_local, submit_generic
export submit, submit_local, submit_generic

#=
JSON structure for Codecov.io
Expand Down Expand Up @@ -192,16 +192,9 @@ module Codecov
end
end

if haskey(ENV, "REPO_TOKEN")
@warn "the environment variable REPO_TOKEN is deprecated, use CODECOV_TOKEN instead"
kwargs = set_defaults(kwargs, token = ENV["REPO_TOKEN"])
end

return kwargs
end

@deprecate submit_token submit_local


"""
submit_generic(fcs::Vector{FileCoverage})
Expand All @@ -220,18 +213,11 @@ module Codecov
function submit_generic(fcs::Vector{FileCoverage}, kwargs::Dict)
@assert length(kwargs) > 0
dry_run = get(kwargs, :dry_run, false)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end

uri_str = construct_uri_string(kwargs)

verbose && @info "Submitting data to Codecov..."
verbose && @debug "Codecov.io API URL:\n" * mask_token(uri_str)
@info "Submitting data to Codecov..."
@debug "Codecov.io API URL:\n" * mask_token(uri_str)

if !dry_run
heads = Dict("Content-Type" => "application/json")
Expand Down
27 changes: 6 additions & 21 deletions src/coveralls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Coveralls
using LibGit2
using MbedTLS

export submit, submit_token, submit_local
export submit, submit_local

#=
JSON structure for Coveralls
Expand Down Expand Up @@ -62,15 +62,8 @@ module Coveralls
on TravisCI, AppVeyor or Jenkins. If running locally, use `submit_local`.
"""
function submit(fcs::Vector{FileCoverage}; kwargs...)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end
data = prepare_request(fcs, false)
post_request(data, verbose)
post_request(data)
end

function prepare_request(fcs::Vector{FileCoverage}, local_env::Bool, git_info=query_git_info)
Expand Down Expand Up @@ -204,23 +197,16 @@ module Coveralls
git_info can be either a `Dict` or a function that returns a `Dict`.
"""
function submit_local(fcs::Vector{FileCoverage}, git_info=query_git_info; kwargs...)
if haskey(kwargs, :verbose)
Base.depwarn("The verbose keyword argument is deprecated, set the environment variable " *
"JULIA_DEBUG=Coverage for verbose output", :submit_generic)
verbose = kwargs[:verbose]
else
verbose = false
end
data = prepare_request(fcs, true, git_info)
post_request(data, verbose)
post_request(data)
end

# posts the actual request given the data
function post_request(data, verbose)
verbose && @info "Submitting data to Coveralls..."
function post_request(data)
@info "Submitting data to Coveralls..."
coveralls_url = get(ENV, "COVERALLS_URL", "https://coveralls.io/api/v1/jobs")
req = HTTP.post(coveralls_url, HTTP.Form(makebody(data)))
verbose && @debug "Result of submission:\n" * String(req.body)
@debug "Result of submission:\n" * String(req)
nothing
end

Expand All @@ -240,6 +226,5 @@ module Coveralls
end
return data
end
@deprecate submit_token submit_local

end # module Coveralls

0 comments on commit 0212b76

Please sign in to comment.