2017-08-11 22:18:09 +00:00
|
|
|
"""
|
2018-09-17 19:40:09 +00:00
|
|
|
CodeCov(; config_file::Union{AbstractString, Nothing}=nothing) -> CodeCov
|
2017-08-11 22:18:09 +00:00
|
|
|
|
2017-10-27 15:47:56 +00:00
|
|
|
Add `CodeCov` to a template's plugins to optionally add a `.codecov.yml` configuration file
|
|
|
|
to generated repositories, and an appropriate badge to the README. Also updates the
|
2017-08-17 22:06:05 +00:00
|
|
|
`.gitignore` accordingly.
|
2017-08-11 22:18:09 +00:00
|
|
|
|
|
|
|
# Keyword Arguments:
|
2018-09-17 19:40:09 +00:00
|
|
|
* `config_file::Union{AbstractString, Nothing}=nothing`: Path to a custom `.codecov.yml`.
|
2017-10-27 15:47:56 +00:00
|
|
|
If left unset, 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}
|
2018-09-17 19:40:09 +00:00
|
|
|
src::Union{AbstractString, Nothing}
|
2017-08-17 06:57:58 +00:00
|
|
|
dest::AbstractString
|
2017-08-18 04:06:15 +00:00
|
|
|
badges::Vector{Badge}
|
2017-08-17 06:57:58 +00:00
|
|
|
view::Dict{String, Any}
|
2017-08-11 22:18:09 +00:00
|
|
|
|
2018-09-17 19:40:09 +00:00
|
|
|
function CodeCov(; config_file::Union{AbstractString, Nothing}=nothing)
|
2017-08-12 03:36:29 +00:00
|
|
|
if config_file != nothing
|
2017-10-27 15:47:56 +00:00
|
|
|
config_file = if isfile(config_file)
|
2017-10-02 04:26:02 +00:00
|
|
|
abspath(config_file)
|
|
|
|
else
|
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
|
|
|
[
|
2017-08-18 04:06:15 +00:00
|
|
|
Badge(
|
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-18 04:06:15 +00:00
|
|
|
),
|
2017-08-17 22:06:05 +00:00
|
|
|
],
|
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
|
2017-10-27 15:47:56 +00:00
|
|
|
|
|
|
|
interactive(plugin_type::Type{CodeCov}) = interactive(plugin_type; file=nothing)
|