benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
670 stars 85 forks source link

Name not inferred correctly in LICENSE when using `create_compendium` #94

Closed annakrystalli closed 4 years ago

annakrystalli commented 4 years ago

Please wait for some discussion of your report before making a Pull Request.

Describe the bug use_git_config() no longer seems to return the user.name and user.email. As such, when running create_compendium(), the name in LICENSE and license.md is not correctly populated (ie is completely missing).

To Reproduce

rrtools::create_compendium("~/Desktop/rrcompendium")

Expected behavior

Perhaps trying to infer the name from option usethis.fullname would be better and if not possible, to either pause and prompt users to enter a name interactively during initialisation or throw a warning at the end to inform users that the name is missing in the license and needs completing manually.

benmarwick commented 4 years ago

Thanks for spotting this, it could be that use_git_config() changed recently so it 'invisibly' returns nothing. Here's a discussion on the usethis repo: https://github.com/r-lib/usethis/issues/668 and where it was documented in a vignette: https://github.com/r-lib/usethis/blob/f08ecb6480310edd0e1c9b24e1d55359056804ec/vignettes/articles/usethis-setup.Rmd#L72-L73

Seems like use_git_config() is now an unexported function in the usethis pkg, so we can update rrtools::create_compendium with usethis:::git_config_get("user.name", global = TRUE) to fix this.

benmarwick commented 4 years ago

https://github.com/benmarwick/rrtools/commit/0e34d5f5249df1b72ed577be44d5adbed560a93a fixes this