From b4731273a096f3043a40f52611eb71faaac33e14 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Mon, 14 Aug 2017 13:12:37 -0500 Subject: [PATCH] Use AutoHashEquals --- REQUIRE | 3 +++ src/PkgTemplates.jl | 2 +- src/plugins/appveyor.jl | 7 +------ src/plugins/codecov.jl | 7 +------ src/plugins/githubpages.jl | 1 + src/plugins/travis.jl | 7 +------ src/template.jl | 2 +- 7 files changed, 9 insertions(+), 20 deletions(-) diff --git a/REQUIRE b/REQUIRE index 137767a..64ea3a9 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1,4 @@ julia 0.6 +AutoHashEquals +Mustache +URIParser diff --git a/src/PkgTemplates.jl b/src/PkgTemplates.jl index 948b0c6..ea8fe2c 100644 --- a/src/PkgTemplates.jl +++ b/src/PkgTemplates.jl @@ -1,6 +1,6 @@ module PkgTemplates -import Base.== +using AutoHashEquals using Mustache using URIParser diff --git a/src/plugins/appveyor.jl b/src/plugins/appveyor.jl index 29ead50..5739d46 100644 --- a/src/plugins/appveyor.jl +++ b/src/plugins/appveyor.jl @@ -7,7 +7,7 @@ Add AppVeyor to a template's plugins to add AppVeyor CI support. * `config_file::Union{AbstractString, Void}`: Path to a custom `.appveyor.yml`. If `nothing` is supplied, then no file will be generated. """ -struct AppVeyor <: Plugin +@auto_hash_equals struct AppVeyor <: Plugin gitignore_files::Vector{AbstractString} config_file::Union{AbstractString, Void} @@ -24,11 +24,6 @@ struct AppVeyor <: Plugin end end -function ==(a::AppVeyor, b::AppVeyor) - return a.gitignore_files == b.gitignore_files && - a.config_file == b.config_file -end - """ badges(plugin::AppVeyor, pkg_name::AbstractString, t::Template) -> Vector{String} diff --git a/src/plugins/codecov.jl b/src/plugins/codecov.jl index fc8c484..28dfac8 100644 --- a/src/plugins/codecov.jl +++ b/src/plugins/codecov.jl @@ -7,7 +7,7 @@ Add CodeCov to a template's plugins to enable CodeCov coverage reports. * `config_file::AbstractString`: Path to a custom `.codecov.yml`. If `nothing` is supplied, then no file will be generated. """ -struct CodeCov <: Plugin +@auto_hash_equals struct CodeCov <: Plugin gitignore_files::Vector{AbstractString} config_file::AbstractString @@ -24,11 +24,6 @@ struct CodeCov <: Plugin end end -function ==(a::CodeCov, b::CodeCov) - return a.gitignore_files == b.gitignore_files && - a.config_file == b.config_file -end - """ badges(plugin::CodeCov, pkg_name::AbstractString, t::Template) -> Vector{String} diff --git a/src/plugins/githubpages.jl b/src/plugins/githubpages.jl index 0574354..c20dd1e 100644 --- a/src/plugins/githubpages.jl +++ b/src/plugins/githubpages.jl @@ -7,6 +7,7 @@ Add GitHubPages to a template's plugins to add Documenter.jl support via GitHub * `documenter_assets::Vector{String}=String[]`: Array of paths to Documenter asset files. """ struct GitHubPages <: Documenter +@auto_hash_equals struct GitHubPages <: Documenter gitignore_files::Vector{AbstractString} documenter_assets::Vector{AbstractString} diff --git a/src/plugins/travis.jl b/src/plugins/travis.jl index 04c8f3e..1ecdbf5 100644 --- a/src/plugins/travis.jl +++ b/src/plugins/travis.jl @@ -7,7 +7,7 @@ Add TravisCI to a template's plugins to add Travis CI support. * `config_file::AbstractString`: Path to a custom `.travis.yml`. If `nothing` is supplied, then no file will be generated. """ -struct TravisCI <: Plugin +@auto_hash_equals struct TravisCI <: Plugin gitignore_files::Vector{AbstractString} config_file::Union{AbstractString, Void} @@ -24,11 +24,6 @@ struct TravisCI <: Plugin end end -function ==(a::TravisCI, b::TravisCI) - return a.gitignore_files == b.gitignore_files && - a.config_file == b.config_file -end - """ badges(plugin::TravisCI, pkg_name::AbstractString, t::Template) -> Vector{String} diff --git a/src/template.jl b/src/template.jl index 929cdb3..b360995 100644 --- a/src/template.jl +++ b/src/template.jl @@ -20,7 +20,7 @@ Records common information used to generate a package. * `git_config::Dict{String, String}=Dict{String, String}()`: Git configuration options. * `plugins::Vector{Plugin}`: A list of `Plugin`s that the package will include. """ -struct Template +@auto_hash_equals struct Template remote_prefix::AbstractString license::Union{AbstractString, Void} authors::Union{AbstractString, Array}