Remove default CodeCov config
This commit is contained in:
parent
4974e58af9
commit
3b8abd5cbe
@ -1 +0,0 @@
|
||||
comment: false
|
@ -1,13 +1,13 @@
|
||||
"""
|
||||
CodeCov(; config_file::Union{AbstractString, Void}="") -> CodeCov
|
||||
CodeCov(; config_file::Union{AbstractString, Void}=nothing) -> CodeCov
|
||||
|
||||
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
|
||||
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
|
||||
`.gitignore` accordingly.
|
||||
|
||||
# Keyword Arguments:
|
||||
* `config_file::Union{AbstractString, Void}=""`: Path to a custom `.codecov.yml`.
|
||||
If `nothing` is supplied, no file will be generated.
|
||||
* `config_file::Union{AbstractString, Void}=nothing`: Path to a custom `.codecov.yml`.
|
||||
If left unset, no file will be generated.
|
||||
"""
|
||||
@auto_hash_equals struct CodeCov <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
@ -16,11 +16,9 @@ generated repositories, and an appropriate badge to the README. Also updates the
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
function CodeCov(; config_file::Union{AbstractString, Void}="")
|
||||
function CodeCov(; config_file::Union{AbstractString, Void}=nothing)
|
||||
if config_file != nothing
|
||||
config_file = if isempty(config_file)
|
||||
config_file = joinpath(DEFAULTS_DIR, "codecov.yml")
|
||||
elseif isfile(config_file)
|
||||
config_file = if isfile(config_file)
|
||||
abspath(config_file)
|
||||
else
|
||||
throw(ArgumentError("File $(abspath(config_file)) does not exist"))
|
||||
@ -41,3 +39,5 @@ generated repositories, and an appropriate badge to the README. Also updates the
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
interactive(plugin_type::Type{CodeCov}) = interactive(plugin_type; file=nothing)
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Coveralls(; config_file::Union{AbstractString, Void}="") -> Coveralls
|
||||
Coveralls(; config_file::Union{AbstractString, Void}=nothing) -> Coveralls
|
||||
|
||||
Add `Coveralls` to a template's plugins to optionally add a `.coveralls.yml` configuration
|
||||
file to generated repositories, and an appropriate badge to the README. Also updates the
|
||||
|
@ -50,7 +50,7 @@ end
|
||||
@testset "CodeCov" begin
|
||||
write(STDIN.buffer, "\n")
|
||||
p = interactive(CodeCov)
|
||||
@test get(p.src, "") == joinpath(DEFAULTS_DIR, "codecov.yml")
|
||||
@test isnull(p.src)
|
||||
write(STDIN.buffer, "$test_file\n")
|
||||
p = interactive(CodeCov)
|
||||
@test get(p.src, "") == test_file
|
||||
|
@ -7,7 +7,7 @@ pkg_dir = joinpath(temp_dir, test_pkg)
|
||||
@testset "Plugin creation" begin
|
||||
p = CodeCov()
|
||||
@test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"]
|
||||
@test get(p.src, "") == joinpath(PkgTemplates.DEFAULTS_DIR, "codecov.yml")
|
||||
@test isnull(p.src)
|
||||
@test p.dest == ".codecov.yml"
|
||||
@test p.badges == [
|
||||
Badge(
|
||||
@ -31,9 +31,8 @@ pkg_dir = joinpath(temp_dir, test_pkg)
|
||||
|
||||
@testset "File generation" begin
|
||||
p = CodeCov()
|
||||
@test gen_plugin(p, t, temp_dir, test_pkg) == [".codecov.yml"]
|
||||
@test isfile(joinpath(pkg_dir, ".codecov.yml"))
|
||||
rm(joinpath(pkg_dir, ".codecov.yml"))
|
||||
@test isempty(gen_plugin(p, t, temp_dir, test_pkg))
|
||||
@test !isfile(joinpath(pkg_dir, ".codecov.yml"))
|
||||
p = CodeCov(; config_file=nothing)
|
||||
@test isempty(gen_plugin(p, t, temp_dir, test_pkg))
|
||||
@test !isfile(joinpath(pkg_dir, ".codecov.yml"))
|
||||
|
@ -265,7 +265,6 @@ end
|
||||
@test !isfile(Pkg.dir(test_pkg, "LICENSE"))
|
||||
@test isfile(Pkg.dir(test_pkg, ".travis.yml"))
|
||||
@test isfile(Pkg.dir(test_pkg, ".appveyor.yml"))
|
||||
@test isfile(Pkg.dir(test_pkg, ".codecov.yml"))
|
||||
@test isdir(Pkg.dir(test_pkg, "docs"))
|
||||
@test isfile(Pkg.dir(test_pkg, "docs", "make.jl"))
|
||||
@test isdir(Pkg.dir(test_pkg, "docs", "src"))
|
||||
|
Loading…
Reference in New Issue
Block a user