Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive template error #179

Closed
ericphanson opened this issue Jun 2, 2020 · 6 comments · Fixed by #180
Closed

Interactive template error #179

ericphanson opened this issue Jun 2, 2020 · 6 comments · Fixed by #180

Comments

@ericphanson
Copy link
Contributor

I ran into the following error:

julia> t = interactive_template()
┌ Warning: `interactive_template()` is deprecated, use `Template(; interactive = true)` instead.
│   caller = top-level scope at REPL[3]:1
└ @ Core REPL[3]:1
Template keywords to customize:
[press: d=done, a=all, n=none]
   [ ] user
   [ ] authors
   [ ] dir
   [ ] host
   [ ] julia
 > [X] plugins
Select plugins:
[press: d=done, a=all, n=none]
   [X] CompatHelper
   [X] ProjectFile
   [X] SrcDir
   [X] Git
   [X] License
   [X] Readme
   [X] Tests
   [X] TagBot
   [ ] AppVeyor
   [ ] CirrusCI
   [ ] Citation
   [X] Codecov
   [ ] Coveralls
   [ ] Develop
   [X] Documenter
   [ ] DroneCI
   [X] GitHubActions
   [ ] GitLabCI
 > [ ] TravisCI
CompatHelper keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] cron
   [ ] destination
   [ ] file
ProjectFile keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] version
   [ ] None
SrcDir keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] destination
   [ ] file
Git keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] email
   [ ] gpgsign
   [ ] ignore
   [ ] jl
   [ ] manifest
   [ ] name
   [ ] ssh
License keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] destination
   [ ] name
   [ ] path
Readme keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] destination
   [ ] file
   [ ] inline_badges
Tests keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] file
   [ ] project
TagBot keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] branches
   [ ] changelog
   [ ] changelog_ignore
   [ ] cron
   [ ] destination
   [ ] dispatch
   [ ] dispatch_delay
   [ ] file
   [ ] gpg
   [ ] gpg_password
   [ ] registry
   [ ] ssh
   [ ] ssh_password
   [ ] token
Codecov keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] file
   [ ] None
Documenter deploy style:
   Nothing
   TravisCI
   GitLabCI
 > GitHubActions
Documenter keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] assets
   [ ] index_md
   [ ] make_jl
GitHubActions keywords to customize:
[press: d=done, a=all, n=none]
 > [ ] coverage
   [ ] destination
   [ ] extra_versions
   [ ] file
   [ ] linux
   [ ] osx
   [ ] windows
   [ ] x64
   [ ] x86
ERROR: ArgumentError: Codecov: Git hosting service username is required, set one with keyword `user="<username>"`
Stacktrace:
 [1] (::PkgTemplates.var"#8#14")(::Codecov) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:101
 [2] foreach(::PkgTemplates.var"#8#14", ::Array{PkgTemplates.Plugin,1}) at ./abstractarray.jl:1919
 [3] Template(::Val{false}; kwargs::Base.Iterators.Pairs{Symbol,Array{Any,1},Tuple{Symbol},NamedTuple{(:plugins,),Tuple{Array{Any,1}}}}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:97
 [4] Template(; interactive::Bool, kwargs::Base.Iterators.Pairs{Symbol,Array{Any,1},Tuple{Symbol},NamedTuple{(:plugins,),Tuple{Array{Any,1}}}}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:75
 [5] interactive(::Type{Template}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:198
 [6] interactive(::Type{Template}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:178
 [7] Template(::Val{true}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:76
 [8] Template(::Val{true}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:76
 [9] Template(; interactive::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/eric/.julia/packages/PkgTemplates/jMe8Z/src/template.jl:75
 [10] interactive_template() at ./deprecated.jl:67
 [11] top-level scope at REPL[3]:1
 [12] eval(::Module, ::Any) at ./boot.jl:331
 [13] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [14] run_backend(::REPL.REPLBackend) at /home/eric/.julia/packages/Revise/XFtoQ/src/Revise.jl:1162
 [15] top-level scope at none:0

Seems like it could handle this more gracefully by prompting for the name instead of throwing.

@christopher-dG
Copy link
Member

christopher-dG commented Jun 2, 2020

Maybe, but I feel like it's kind of a slippery slope to prompt for everything that was incorrect or not supplied. In this case I feel like the error is sufficiently informative.

Although it would be nice if it was more obvious that user's default value was missing, #177 could help with that.

@ericphanson
Copy link
Contributor Author

Ok, fair enough, that might help. It seems strange as-is because you get what seems like options to customize things, but if you don't choose to do so, you get an error later on.

@ericphanson
Copy link
Contributor Author

Maybe, but I feel like it's kind of a slippery slope to prompt for everything that was incorrect or not supplied. In this case I feel like the error is sufficiently informative.

Actually, on second thought, I'm not sure that's a bad slope to go down-- it's an interactive mode, after all. (Not saying the work should fall on you to do it! Just saying it actually sounds like a good way to resolve missing or incorrect info in an interactive setting).

@christopher-dG
Copy link
Member

I'll note that the user keyword is one of very few cases that can cause template construction to throw. But it's also pretty common, so perhaps it is worth special casing 🙂

@ericphanson
Copy link
Contributor Author

Thanks for the speedy fix @christopher-dG! I checked that it works fine for me on master.

@christopher-dG
Copy link
Member

Awesome! A new version should be released later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants