2017-08-11 22:18:09 +00:00
|
|
|
"""
|
2017-08-17 06:57:58 +00:00
|
|
|
CodeCov(; config_file::Union{AbstractString, Void}="") -> GenericPlugin
|
2017-08-11 22:18:09 +00:00
|
|
|
|
2017-08-17 22:06:05 +00:00
|
|
|
Add `CodeCov` to a template's plugins to add a `.codecov.yml` configuration file to
|
|
|
|
generated repositories, and an appropriate badge to the README. Also updates the
|
|
|
|
`.gitignore` accordingly.
|
2017-08-11 22:18:09 +00:00
|
|
|
|
|
|
|
# Keyword Arguments:
|
2017-08-16 06:58:54 +00:00
|
|
|
* `config_file::Union{AbstractString, Void}=""`: Path to a custom `.codecov.yml`.
|
2017-08-17 06:57:58 +00:00
|
|
|
If `nothing` is supplied, no file will be generated.
|
2017-08-11 22:18:09 +00:00
|
|
|
"""
|
2017-08-17 06:57:58 +00:00
|
|
|
@auto_hash_equals struct CodeCov <: GenericPlugin
|
|
|
|
gitignore::Vector{AbstractString}
|
|
|
|
src::Nullable{AbstractString}
|
|
|
|
dest::AbstractString
|
2017-08-17 22:06:05 +00:00
|
|
|
badges::Vector{Vector{AbstractString}}
|
2017-08-17 06:57:58 +00:00
|
|
|
view::Dict{String, Any}
|
2017-08-11 22:18:09 +00:00
|
|
|
|
2017-08-14 18:59:33 +00:00
|
|
|
function CodeCov(; config_file::Union{AbstractString, Void}="")
|
2017-08-12 03:36:29 +00:00
|
|
|
if config_file != nothing
|
|
|
|
if isempty(config_file)
|
|
|
|
config_file = joinpath(DEFAULTS_DIR, "codecov.yml")
|
2017-08-17 06:57:58 +00:00
|
|
|
elseif !isfile(config_file)
|
2017-08-16 05:33:07 +00:00
|
|
|
throw(ArgumentError("File $(abspath(config_file)) does not exist"))
|
2017-08-12 03:36:29 +00:00
|
|
|
end
|
2017-08-11 22:18:09 +00:00
|
|
|
end
|
2017-08-17 06:57:58 +00:00
|
|
|
new(
|
|
|
|
["*.jl.cov", "*.jl.*.cov", "*.jl.mem"],
|
|
|
|
config_file,
|
|
|
|
".codecov.yml",
|
2017-08-17 22:06:05 +00:00
|
|
|
[
|
|
|
|
[
|
|
|
|
"CodeCov",
|
|
|
|
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl/branch/master/graph/badge.svg",
|
|
|
|
"https://codecov.io/gh/{{USER}}/{{PKGNAME}}.jl",
|
|
|
|
],
|
|
|
|
],
|
2017-08-17 06:57:58 +00:00
|
|
|
Dict{String, Any}(),
|
|
|
|
)
|
2017-08-12 03:36:29 +00:00
|
|
|
end
|
2017-08-11 22:18:09 +00:00
|
|
|
end
|