Skip to content

Commit

Permalink
Tweak documentation; indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Oct 22, 2024
1 parent 95f21d2 commit faa899e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
4 changes: 3 additions & 1 deletion R/tidyverse.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
#' tidyverse conventions around GitHub issue label names and colours.
#'
#' * `use_tidy_upkeep_issue()` creates an issue containing a checklist of
#' actions to bring your package up to current tidyverse standards.
#' actions to bring your package up to current tidyverse standards. Also
#' records the current date in the `Config/usethis/last-upkeep` field in
#' `DESCRIPTION`.
#'
#' * `use_tidy_logo()` calls `use_logo()` on the appropriate hex sticker PNG
#' file at <https://github.com/rstudio/hex-stickers>.
Expand Down
14 changes: 9 additions & 5 deletions R/upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ upkeep_checklist <- function(target_repo = NULL) {

#' @export
#' @rdname tidyverse
#' @param last_upkeep Approximate year when you last touched this package. Default will
#' use the recorded year of the last upkeep issue or, if missing, show the full
#' checklist
#' @param last_upkeep Year of last upkeep. By default, the
#' `Config/usethis/last-upkeep` field in `DESCRIPTION` is consulted for this, if
#' it's defined. If there's no information on the last upkeep, the issue will
#' contain the full checklist.
use_tidy_upkeep_issue <- function(last_upkeep = last_upkeep_year()) {
make_upkeep_issue(year = NULL, last_upkeep = last_upkeep, tidy = TRUE)
record_upkeep_date(Sys.Date())

Check warning on line 127 in R/upkeep.R

View check run for this annotation

Codecov / codecov/patch

R/upkeep.R#L126-L127

Added lines #L126 - L127 were not covered by tests
Expand Down Expand Up @@ -331,13 +332,16 @@ has_old_cran_comments <- function() {
}

last_upkeep_date <- function() {
as.Date(proj_desc()$get_field("Config/usethis/last-upkeep", "2000-01-01"), format = "%Y-%m-%d")
as.Date(
proj_desc()$get_field("Config/usethis/last-upkeep", "2000-01-01"),
format = "%Y-%m-%d"
)
}

last_upkeep_year <- function() {
as.integer(format(last_upkeep_date(), "%Y"))
}

record_upkeep_date <- function(date) {
desc <- proj_desc_field_update("Config/usethis/last-upkeep", format(date, "%Y-%m-%d"))
proj_desc_field_update("Config/usethis/last-upkeep", format(date, "%Y-%m-%d"))
}
11 changes: 7 additions & 4 deletions man/tidyverse.Rd

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

0 comments on commit faa899e

Please sign in to comment.