Unbind plugin parameter in badges

This commit is contained in:
Chris de Graaf 2017-08-14 13:59:33 -05:00
parent 4ffe092e6f
commit 315101978b
4 changed files with 14 additions and 14 deletions

View File

@ -25,18 +25,18 @@ Add AppVeyor to a template's plugins to add AppVeyor CI support.
end end
""" """
badges(plugin::AppVeyor, pkg_name::AbstractString, t::Template) -> Vector{String} badges(\_::AppVeyor, pkg_name::AbstractString, t::Template) -> Vector{String}
Generate Markdown badges for the current package. Generate Markdown badges for the current package.
# Arguments # Arguments
* `plugin::AppVeyor`: Plugin whose badges we are generating. * `_::AppVeyor`: Plugin whose badges we are generating.
* `t::Template`: Template configuration options. * `t::Template`: Template configuration options.
* `pkg_name::AbstractString`: Name of the package. * `pkg_name::AbstractString`: Name of the package.
Returns an array of Markdown badges. Returns an array of Markdown badges.
""" """
function badges(plugin::AppVeyor, t::Template, pkg_name::AbstractString) function badges(_::AppVeyor, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/') user = strip(URI(t.remote_prefix).path, '/')
return [ return [
"[![Build status](https://ci.appveyor.com/api/projects/status/github/$user/$pkg_name.jl?svg=true)](https://ci.appveyor.com/project/$user/$pkg_name-jl)" "[![Build status](https://ci.appveyor.com/api/projects/status/github/$user/$pkg_name.jl?svg=true)](https://ci.appveyor.com/project/$user/$pkg_name-jl)"

View File

@ -9,9 +9,9 @@ Add CodeCov to a template's plugins to enable CodeCov coverage reports.
""" """
@auto_hash_equals struct CodeCov <: Plugin @auto_hash_equals struct CodeCov <: Plugin
gitignore_files::Vector{AbstractString} gitignore_files::Vector{AbstractString}
config_file::AbstractString config_file::Union{AbstractString, Void}
function CodeCov(; config_file::AbstractString="") function CodeCov(; config_file::Union{AbstractString, Void}="")
if config_file != nothing if config_file != nothing
if isempty(config_file) if isempty(config_file)
config_file = joinpath(DEFAULTS_DIR, "codecov.yml") config_file = joinpath(DEFAULTS_DIR, "codecov.yml")
@ -25,18 +25,18 @@ Add CodeCov to a template's plugins to enable CodeCov coverage reports.
end end
""" """
badges(plugin::CodeCov, pkg_name::AbstractString, t::Template) -> Vector{String} badges(\_::CodeCov, pkg_name::AbstractString, t::Template) -> Vector{String}
Generate Markdown badges for the current package. Generate Markdown badges for the current package.
# Arguments # Arguments
* `plugin::CodeCov`: plugin whose badges we are generating. * `_::CodeCov`: plugin whose badges we are generating.
* `t::Template`: Template configuration options. * `t::Template`: Template configuration options.
* `pkg_name::AbstractString`: Name of the package. * `pkg_name::AbstractString`: Name of the package.
Returns an array of Markdown badges. Returns an array of Markdown badges.
""" """
function badges(plugin::CodeCov, t::Template, pkg_name::AbstractString) function badges(_::CodeCov, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/') user = strip(URI(t.remote_prefix).path, '/')
return [ return [
"[![codecov](https://codecov.io/gh/$user/$pkg_name.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$user/$pkg_name.jl)" "[![codecov](https://codecov.io/gh/$user/$pkg_name.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/$user/$pkg_name.jl)"

View File

@ -22,18 +22,18 @@ Add GitHubPages to a template's plugins to add Documenter.jl support via GitHub
end end
""" """
badges(plugin::GitHubPages, pkg_name::AbstractString, t::Template) -> Vector{String} badges(\_::GitHubPages, pkg_name::AbstractString, t::Template) -> Vector{String}
Generate Markdown badges for the current package. Generate Markdown badges for the current package.
# Arguments # Arguments
* `plugin::GitHubPages`: plugin whose badges we are generating. * `_::GitHubPages`: plugin whose badges we are generating.
* `t::Template`: Template configuration options. * `t::Template`: Template configuration options.
* `pkg_name::AbstractString`: Name of the package. * `pkg_name::AbstractString`: Name of the package.
Returns an array of Markdown badges. Returns an array of Markdown badges.
""" """
function badges(plugin::GitHubPages, t::Template, pkg_name::AbstractString) function badges(_::GitHubPages, t::Template, pkg_name::AbstractString)
if haskey(t.plugins, TravisCI) if haskey(t.plugins, TravisCI)
user = strip(URI(t.remote_prefix).path, '/') user = strip(URI(t.remote_prefix).path, '/')
return [ return [

View File

@ -25,18 +25,18 @@ Add TravisCI to a template's plugins to add Travis CI support.
end end
""" """
badges(plugin::TravisCI, pkg_name::AbstractString, t::Template) -> Vector{String} badges(\_::TravisCI, pkg_name::AbstractString, t::Template) -> Vector{String}
Generate Markdown badges for the current package. Generate Markdown badges for the current package.
# Arguments # Arguments
* `plugin::TravisCI`: plugin whose badges we are generating. * `_::TravisCI`: plugin whose badges we are generating.
* `t::Template`: Template configuration and plugins. * `t::Template`: Template configuration and plugins.
* `pkg_name::AbstractString`: Name of the package. * `pkg_name::AbstractString`: Name of the package.
Returns an array of Markdown badges. Returns an array of Markdown badges.
""" """
function badges(plugin::TravisCI, t::Template, pkg_name::AbstractString) function badges(_::TravisCI, t::Template, pkg_name::AbstractString)
user = strip(URI(t.remote_prefix).path, '/') user = strip(URI(t.remote_prefix).path, '/')
return [ return [
"[![Build Status](https://travis-ci.org/$user/$pkg_name.jl.svg?branch=master)](https://travis-ci.org/$user/$pkg_name.jl)" "[![Build Status](https://travis-ci.org/$user/$pkg_name.jl.svg?branch=master)](https://travis-ci.org/$user/$pkg_name.jl)"