Update show style
This commit is contained in:
parent
ffd288a6b2
commit
7e38c92413
@ -70,6 +70,7 @@ config template file doesn't follow the generic naming convention, we added anot
|
|||||||
abstract type GenericPlugin <: Plugin end
|
abstract type GenericPlugin <: Plugin end
|
||||||
|
|
||||||
function show(io::IO, p::GenericPlugin)
|
function show(io::IO, p::GenericPlugin)
|
||||||
|
spc = " "
|
||||||
t = split(string(typeof(p)), ".")[end]
|
t = split(string(typeof(p)), ".")[end]
|
||||||
println(io, "$t:")
|
println(io, "$t:")
|
||||||
|
|
||||||
@ -78,11 +79,11 @@ function show(io::IO, p::GenericPlugin)
|
|||||||
else
|
else
|
||||||
dirname(get(p.src)) == DEFAULTS_DIR ? "Default" : get(p.src)
|
dirname(get(p.src)) == DEFAULTS_DIR ? "Default" : get(p.src)
|
||||||
end
|
end
|
||||||
println(io, " → Config file: $cfg")
|
println(io, "$spc→ Config file: $cfg")
|
||||||
|
|
||||||
n = length(p.gitignore)
|
n = length(p.gitignore)
|
||||||
s = n == 1 ? "" : "s"
|
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), ", "))")
|
n > 0 && print(io, ": $(join(map(g -> "\"$g\"", p.gitignore), ", "))")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -120,28 +120,26 @@ function show(io::IO, t::Template)
|
|||||||
println(io, "Template:")
|
println(io, "Template:")
|
||||||
println(io, "$spc→ User: $(maybe_none(t.user))")
|
println(io, "$spc→ User: $(maybe_none(t.user))")
|
||||||
println(io, "$spc→ Host: $(maybe_none(t.host))")
|
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.
|
print(io, "$spc→ License: ")
|
||||||
if !isempty(t.license)
|
if isempty(t.license)
|
||||||
# TODO: Authors could be split into multiple lines if there are more than one.
|
println(io, "None")
|
||||||
# Maybe the authors field of Template should be an array (or Dict, see #4).
|
else
|
||||||
println(io, "$spc→ Authors: $(maybe_none(t.authors))")
|
println(io, "$(t.license) ($(t.authors) $(t.years))")
|
||||||
println(io, "$spc→ License years: $(maybe_none(t.years))")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
println(io, "$spc→ Package directory: $(replace(maybe_none(t.dir), homedir(), "~"))")
|
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)")
|
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)
|
if isempty(t.requirements)
|
||||||
println(io, " None")
|
|
||||||
else
|
|
||||||
println(io)
|
println(io)
|
||||||
for req in sort(t.requirements)
|
else
|
||||||
println(io, "$(spc^2)• $req")
|
println(io, ": $(join(t.requirements, ", "))")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
print(io, "$spc→ Git configuration options:")
|
print(io, "$spc→ Git configuration options:")
|
||||||
|
@ -135,13 +135,11 @@ end
|
|||||||
Template:
|
Template:
|
||||||
→ User: $me
|
→ User: $me
|
||||||
→ Host: github.com
|
→ Host: github.com
|
||||||
→ License: MIT
|
→ License: MIT ($(gitconfig["user.name"]) $(Dates.year(now())))
|
||||||
→ Authors: $(gitconfig["user.name"])
|
|
||||||
→ License years: 2017
|
|
||||||
→ Package directory: $pkgdir
|
→ Package directory: $pkgdir
|
||||||
→ Precompilation enabled: yes
|
→ Precompilation enabled: Yes
|
||||||
→ Minimum Julia version: v$VERSION
|
→ Minimum Julia version: v$VERSION
|
||||||
→ Package dependencies: None
|
→ 0 package requirements
|
||||||
→ Git configuration options:
|
→ Git configuration options:
|
||||||
• github.user = $(gitconfig["github.user"])
|
• github.user = $(gitconfig["github.user"])
|
||||||
• user.email = $(gitconfig["user.email"])
|
• user.email = $(gitconfig["user.email"])
|
||||||
@ -168,11 +166,9 @@ end
|
|||||||
→ Host: github.com
|
→ Host: github.com
|
||||||
→ License: None
|
→ License: None
|
||||||
→ Package directory: $pkgdir
|
→ Package directory: $pkgdir
|
||||||
→ Precompilation enabled: yes
|
→ Precompilation enabled: Yes
|
||||||
→ Minimum Julia version: v$VERSION
|
→ Minimum Julia version: v$VERSION
|
||||||
→ Package dependencies:
|
→ 2 package requirements: Bar, Foo
|
||||||
• Bar
|
|
||||||
• Foo
|
|
||||||
→ Git configuration options:
|
→ Git configuration options:
|
||||||
• github.user = $(gitconfig["github.user"])
|
• github.user = $(gitconfig["github.user"])
|
||||||
• user.email = $(gitconfig["user.email"])
|
• user.email = $(gitconfig["user.email"])
|
||||||
@ -294,6 +290,8 @@ end
|
|||||||
remote = LibGit2.get(LibGit2.GitRemote, repo, "origin")
|
remote = LibGit2.get(LibGit2.GitRemote, repo, "origin")
|
||||||
branches = [LibGit2.shortname(branch[1]) for branch in LibGit2.GitBranchIter(repo)]
|
branches = [LibGit2.shortname(branch[1]) for branch in LibGit2.GitBranchIter(repo)]
|
||||||
@test LibGit2.getconfig(repo, "user.name", "") == gitconfig["user.name"]
|
@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 LibGit2.url(remote) == "https://github.com/$me/$test_pkg.jl"
|
||||||
@test in("master", branches)
|
@test in("master", branches)
|
||||||
@test !in("gh-pages", branches)
|
@test !in("gh-pages", branches)
|
||||||
|
Loading…
Reference in New Issue
Block a user