Drop AutoHashEquals dep, use concrete types as fields
This commit is contained in:
parent
f3761d5458
commit
bff5a22c7a
@ -1,8 +1,3 @@
|
||||
[[AutoHashEquals]]
|
||||
git-tree-sha1 = "45bb6705d93be619b81451bb2006b7ee5d4e4453"
|
||||
uuid = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
|
||||
version = "0.2.0"
|
||||
|
||||
[[Base64]]
|
||||
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
|
||||
|
@ -4,7 +4,6 @@ authors = ["Chris de Graaf <chrisadegraaf@gmail.com>"]
|
||||
version = "0.4.1"
|
||||
|
||||
[deps]
|
||||
AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
|
||||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
|
||||
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
|
||||
|
@ -1,6 +1,5 @@
|
||||
module PkgTemplates
|
||||
|
||||
using AutoHashEquals
|
||||
using Dates
|
||||
using InteractiveUtils
|
||||
using LibGit2
|
||||
|
@ -21,7 +21,7 @@ Generic plugins are plugins that add any number of patterns to the generated pac
|
||||
|
||||
# Example
|
||||
```julia
|
||||
@auto_hash_equals struct MyPlugin <: GenericPlugin
|
||||
struct MyPlugin <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
@ -96,7 +96,7 @@ signature.
|
||||
|
||||
# Example
|
||||
```julia
|
||||
@auto_hash_equals struct MyPlugin <: CustomPlugin
|
||||
struct MyPlugin <: CustomPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
lucky::Bool
|
||||
|
||||
@ -152,10 +152,10 @@ A `Badge` contains the data necessary to generate a Markdown badge.
|
||||
* `image::AbstractString`: URL to the image to display.
|
||||
* `link::AbstractString`: URL to go to upon clicking the badge.
|
||||
"""
|
||||
@auto_hash_equals struct Badge
|
||||
hover::AbstractString
|
||||
image::AbstractString
|
||||
link::AbstractString
|
||||
struct Badge
|
||||
hover::String
|
||||
image::String
|
||||
link::String
|
||||
end
|
||||
|
||||
"""
|
||||
|
@ -8,10 +8,10 @@ generated repositories, and an appropriate badge to the README.
|
||||
* `config_file::Union{AbstractString, Nothing}=""`: Path to a custom `.appveyor.yml`.
|
||||
If `nothing` is supplied, no file will be generated.
|
||||
"""
|
||||
@auto_hash_equals struct AppVeyor <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
struct AppVeyor <: GenericPlugin
|
||||
gitignore::Vector{String}
|
||||
src::Union{String, Nothing}
|
||||
dest::String
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
|
@ -9,10 +9,10 @@ to generated repositories, and an appropriate badge to the README. Also updates
|
||||
* `config_file::Union{AbstractString, Nothing}=nothing`: Path to a custom `.codecov.yml`.
|
||||
If left unset, no file will be generated.
|
||||
"""
|
||||
@auto_hash_equals struct Codecov <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
struct Codecov <: GenericPlugin
|
||||
gitignore::Vector{String}
|
||||
src::Union{String, Nothing}
|
||||
dest::String
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
|
@ -9,10 +9,10 @@ file to generated repositories, and an appropriate badge to the README. Also upd
|
||||
* `config_file::Union{AbstractString, Nothing}=nothing`: Path to a custom `.coveralls.yml`.
|
||||
If left unset, no file will be generated.
|
||||
"""
|
||||
@auto_hash_equals struct Coveralls <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
struct Coveralls <: GenericPlugin
|
||||
gitignore::Vector{String}
|
||||
src::Union{String, Nothing}
|
||||
dest::String
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
|
@ -13,9 +13,9 @@ adds appropriate badges to the README, and updates the `.gitignore` accordingly.
|
||||
configuration (see
|
||||
[here](https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#SSH-Deploy-Keys-1)).
|
||||
"""
|
||||
@auto_hash_equals struct GitHubPages <: Documenter
|
||||
gitignore::Vector{AbstractString}
|
||||
assets::Vector{AbstractString}
|
||||
struct GitHubPages <: Documenter
|
||||
gitignore::Vector{String}
|
||||
assets::Vector{String}
|
||||
|
||||
function GitHubPages(; assets::Vector{<:AbstractString}=String[])
|
||||
for file in assets
|
||||
|
@ -10,10 +10,10 @@ generated repositories, and appropriate badge(s) to the README.
|
||||
* `coverage::Bool=true`: Whether or not GitLab CI's built-in code coverage analysis should
|
||||
be enabled.
|
||||
"""
|
||||
@auto_hash_equals struct GitLabCI <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
struct GitLabCI <: GenericPlugin
|
||||
gitignore::Vector{String}
|
||||
src::Union{String, Nothing}
|
||||
dest::String
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
|
@ -8,10 +8,10 @@ generated repositories, and an appropriate badge to the README.
|
||||
* `config_file::Union{AbstractString, Nothing}=""`: Path to a custom `.travis.yml`.
|
||||
If `nothing` is supplied, no file will be generated.
|
||||
"""
|
||||
@auto_hash_equals struct TravisCI <: GenericPlugin
|
||||
gitignore::Vector{AbstractString}
|
||||
src::Union{AbstractString, Nothing}
|
||||
dest::AbstractString
|
||||
struct TravisCI <: GenericPlugin
|
||||
gitignore::Vector{String}
|
||||
src::Union{String, Nothing}
|
||||
dest::String
|
||||
badges::Vector{Badge}
|
||||
view::Dict{String, Any}
|
||||
|
||||
|
@ -26,16 +26,16 @@ create a template, you can use [`interactive_template`](@ref) instead.
|
||||
* `manifest::Bool=false`: Whether or not to commit the `Manifest.toml`.
|
||||
* `plugins::Vector{<:Plugin}=Plugin[]`: A list of `Plugin`s that the package will include.
|
||||
"""
|
||||
@auto_hash_equals struct Template
|
||||
user::AbstractString
|
||||
host::AbstractString
|
||||
license::AbstractString
|
||||
authors::AbstractString
|
||||
dir::AbstractString
|
||||
struct Template
|
||||
user::String
|
||||
host::String
|
||||
license::String
|
||||
authors::String
|
||||
dir::String
|
||||
julia_version::VersionNumber
|
||||
ssh::Bool
|
||||
manifest::Bool
|
||||
plugins::Dict{DataType, Plugin}
|
||||
plugins::Dict{DataType, <:Plugin}
|
||||
|
||||
function Template(;
|
||||
user::AbstractString="",
|
||||
|
@ -85,12 +85,9 @@ write(test_file, template_text)
|
||||
user=me,
|
||||
plugins = [GitHubPages(), TravisCI(), AppVeyor(), Codecov(), Coveralls()],
|
||||
)
|
||||
@test Set(keys(t.plugins)) == Set(
|
||||
@test Set(keys(t.plugins)) == Set(map(typeof, values(t.plugins))) == Set(
|
||||
[GitHubPages, TravisCI, AppVeyor, Codecov, Coveralls]
|
||||
)
|
||||
@test Set(values(t.plugins)) == Set(
|
||||
[GitHubPages(), TravisCI(), AppVeyor(), Codecov(), Coveralls()]
|
||||
)
|
||||
|
||||
# Duplicate plugins should warn.
|
||||
@test_logs (:warn, r"duplicates") match_mode=:any t = Template(;
|
||||
|
Loading…
Reference in New Issue
Block a user