diff --git a/src/plugin.jl b/src/plugin.jl index 329ee06..05b8b05 100644 --- a/src/plugin.jl +++ b/src/plugin.jl @@ -70,6 +70,7 @@ config template file doesn't follow the generic naming convention, we added anot abstract type GenericPlugin <: Plugin end function show(io::IO, p::GenericPlugin) + spc = " " t = split(string(typeof(p)), ".")[end] println(io, "$t:") @@ -78,11 +79,11 @@ function show(io::IO, p::GenericPlugin) else dirname(get(p.src)) == DEFAULTS_DIR ? "Default" : get(p.src) end - println(io, " → Config file: $cfg") + println(io, "$spc→ Config file: $cfg") n = length(p.gitignore) s = n == 1 ? "" : "s" - print(io, " → $n gitignore entrie$s") + print(io, "$spc→ $n gitignore entrie$s") n > 0 && print(io, ": $(join(map(g -> "\"$g\"", p.gitignore), ", "))") end diff --git a/src/plugins/documenter.jl b/src/plugins/documenter.jl index e95de4b..714ebe4 100644 --- a/src/plugins/documenter.jl +++ b/src/plugins/documenter.jl @@ -67,7 +67,7 @@ function show(io::IO, p::Documenter) n = length(p.assets) s = n == 1 ? "" : "s" - print(io, " → $n asset file$s") + print(io, " → $n asset file$s") if n == 0 println(io) else @@ -76,7 +76,7 @@ function show(io::IO, p::Documenter) n = length(p.gitignore) s = n == 1 ? "" : "s" - print(io, " → $n gitignore entrie$s") + print(io, " → $n gitignore entrie$s") n > 0 && print(io, ": $(join(map(g -> "\"$g\"", p.gitignore), ", "))") end diff --git a/src/template.jl b/src/template.jl index 2a9121f..bbe9c7f 100644 --- a/src/template.jl +++ b/src/template.jl @@ -120,28 +120,26 @@ function show(io::IO, t::Template) println(io, "Template:") println(io, "$spc→ User: $(maybe_none(t.user))") println(io, "$spc→ Host: $(maybe_none(t.host))") - println(io, "$spc→ License: $(maybe_none(t.license))") - # We don't care about authors or license years if there is no license. - if !isempty(t.license) - # TODO: Authors could be split into multiple lines if there are more than one. - # Maybe the authors field of Template should be an array (or Dict, see #4). - println(io, "$spc→ Authors: $(maybe_none(t.authors))") - println(io, "$spc→ License years: $(maybe_none(t.years))") + print(io, "$spc→ License: ") + if isempty(t.license) + println(io, "None") + else + println(io, "$(t.license) ($(t.authors) $(t.years))") end println(io, "$spc→ Package directory: $(replace(maybe_none(t.dir), homedir(), "~"))") - println(io, "$spc→ Precompilation enabled: $(t.precompile ? "yes" : "no")") + println(io, "$spc→ Precompilation enabled: $(t.precompile ? "Yes" : "No")") println(io, "$spc→ Minimum Julia version: v$(t.julia_version)") - print(io, "$spc→ Package dependencies:") + n = length(t.requirements) + s = n == 1 ? "" : "s" + print(io, "$spc→ $n package requirement$s") + if isempty(t.requirements) - println(io, " None") - else println(io) - for req in sort(t.requirements) - println(io, "$(spc^2)• $req") - end + else + println(io, ": $(join(t.requirements, ", "))") end print(io, "$spc→ Git configuration options:") diff --git a/test/tests.jl b/test/tests.jl index e9dda3f..25f03f0 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -135,13 +135,11 @@ end Template: → User: $me → Host: github.com - → License: MIT - → Authors: $(gitconfig["user.name"]) - → License years: 2017 + → License: MIT ($(gitconfig["user.name"]) $(Dates.year(now()))) → Package directory: $pkgdir - → Precompilation enabled: yes + → Precompilation enabled: Yes → Minimum Julia version: v$VERSION - → Package dependencies: None + → 0 package requirements → Git configuration options: • github.user = $(gitconfig["github.user"]) • user.email = $(gitconfig["user.email"]) @@ -168,25 +166,23 @@ end → Host: github.com → License: None → Package directory: $pkgdir - → Precompilation enabled: yes + → Precompilation enabled: Yes → Minimum Julia version: v$VERSION - → Package dependencies: - • Bar - • Foo + → 2 package requirements: Bar, Foo → Git configuration options: • github.user = $(gitconfig["github.user"]) • user.email = $(gitconfig["user.email"]) • user.name = $(gitconfig["user.name"]) → Plugins: • CodeCov: - → Config file: None - → 3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem" + → Config file: None + → 3 gitignore entries: "*.jl.cov", "*.jl.*.cov", "*.jl.mem" • GitHubPages: - → 0 asset files - → 2 gitignore entries: "/docs/build/", "/docs/site/" + → 0 asset files + → 2 gitignore entries: "/docs/build/", "/docs/site/" • TravisCI: - → Config file: Default - → 0 gitignore entries + → Config file: Default + → 0 gitignore entries """ @test text == rstrip(expected) end @@ -294,6 +290,8 @@ end remote = LibGit2.get(LibGit2.GitRemote, repo, "origin") branches = [LibGit2.shortname(branch[1]) for branch in LibGit2.GitBranchIter(repo)] @test LibGit2.getconfig(repo, "user.name", "") == gitconfig["user.name"] + # Note: This test will fail on your system if you've configured Git + # to replace all HTTPS URLs with SSH. @test LibGit2.url(remote) == "https://github.com/$me/$test_pkg.jl" @test in("master", branches) @test !in("gh-pages", branches)