Skip to content

Commit

Permalink
Omit ORCID placeholder from defaults (#2075)
Browse files Browse the repository at this point in the history
* Stop using placeholder for ORCID identifier

* Might as well use a package that usethis depends on here

* Re-document and rebuild README
  • Loading branch information
jennybc authored Oct 23, 2024
1 parent 64898cd commit c63c6e8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
3 changes: 1 addition & 2 deletions R/author.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#' DESCRIPTION file and the user hasn't given any author information via the
#' `fields` argument or the global option `"usethis.description"`. The
#' placeholder looks something like `First Last <[email protected]> [aut,
#' cre] (YOUR-ORCID-ID)` and `use_author()` offers to remove it in interactive
#' sessions.
#' cre]` and `use_author()` offers to remove it in interactive sessions.
#'
#' @inheritParams utils::person
#' @inheritDotParams utils::person
Expand Down
2 changes: 1 addition & 1 deletion R/description.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ usethis_description_defaults <- function(package = NULL) {
Version = "0.0.0.9000",
Title = "What the Package Does (One Line, Title Case)",
Description = "What the package does (one paragraph).",
"Authors@R" = 'person("First", "Last", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID"))',
"Authors@R" = 'person("First", "Last", email = "[email protected]", role = c("aut", "cre"))',
License = "`use_mit_license()`, `use_gpl3_license()` or friends to pick a license",
Encoding = "UTF-8"
)
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ proj_activate(path)
# Modify the description ----------------------------------------------
use_mit_license("My Name")
use_package("ggplot2", "Suggests")
use_package("rmarkdown", "Suggests")
# Set up other files -------------------------------------------------
use_readme_md()
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ library(usethis)
# Create a new package -------------------------------------------------
path <- file.path(tempdir(), "mypkg")
create_package(path)
#> ✔ Creating '/tmp/RtmpCJHMlj/mypkg/'.
#> ✔ Setting active project to "/private/tmp/RtmpCJHMlj/mypkg".
#> ✔ Creating '/tmp/RtmpPZsquk/mypkg/'.
#> ✔ Setting active project to "/private/tmp/RtmpPZsquk/mypkg".
#> ✔ Creating 'R/'.
#> ✔ Writing 'DESCRIPTION'.
#> Package: mypkg
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#> * First Last <[email protected]> [aut, cre] (YOUR-ORCID-ID)
#> * First Last <[email protected]> [aut, cre]
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#> license
Expand All @@ -79,8 +79,8 @@ create_package(path)
#> ✔ Setting active project to "<no active project>".
# only needed since this session isn't interactive
proj_activate(path)
#> ✔ Setting active project to "/private/tmp/RtmpCJHMlj/mypkg".
#> ✔ Changing working directory to '/tmp/RtmpCJHMlj/mypkg/'
#> ✔ Setting active project to "/private/tmp/RtmpPZsquk/mypkg".
#> ✔ Changing working directory to '/tmp/RtmpPZsquk/mypkg/'

# Modify the description ----------------------------------------------
use_mit_license("My Name")
Expand All @@ -89,11 +89,11 @@ use_mit_license("My Name")
#> ✔ Writing 'LICENSE.md'.
#> ✔ Adding "^LICENSE\\.md$" to '.Rbuildignore'.

use_package("ggplot2", "Suggests")
#> ✔ Adding ggplot2 to 'Suggests' field in DESCRIPTION.
#> ☐ Use `requireNamespace("ggplot2", quietly = TRUE)` to test if ggplot2 is
use_package("rmarkdown", "Suggests")
#> ✔ Adding rmarkdown to 'Suggests' field in DESCRIPTION.
#> ☐ Use `requireNamespace("rmarkdown", quietly = TRUE)` to test if rmarkdown is
#> installed.
#> ☐ Then directly refer to functions with `ggplot2::fun()`.
#> ☐ Then directly refer to functions with `rmarkdown::fun()`.

# Set up other files -------------------------------------------------
use_readme_md()
Expand Down
3 changes: 1 addition & 2 deletions man/use_author.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/author.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
v Adding to 'Authors@R' in DESCRIPTION:
Charlie Brown [ctb]
i 'Authors@R' appears to include a placeholder author:
First Last <[email protected]> [aut, cre] (YOUR-ORCID-ID)
First Last <[email protected]> [aut, cre]

3 changes: 0 additions & 3 deletions tests/testthat/test-author.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ test_that("Decline to tweak an existing author", {
})

test_that("Placeholder author is challenged", {
# apparently the format method for `person` used to handle ORCIDs differently
skip_if(getRversion() < "4.0")

withr::local_options(usethis.description = NULL)
create_local_package()

Expand Down

0 comments on commit c63c6e8

Please sign in to comment.