-
Notifications
You must be signed in to change notification settings - Fork 0
rdev 1.15.0 #226
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
Closed
Closed
rdev 1.15.0 #226
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
78f04f3
Bump version
jabenninghoff 7da169f
renv::update()
jabenninghoff 8f448c7
Update year from 2024 to 2025
jabenninghoff 5a164b5
Update R installation instructions
jabenninghoff 4dd2649
Update R-CMD-check
jabenninghoff 2847e3c
Update lint
jabenninghoff 541fe0e
Update missing-deps
jabenninghoff 1f9aaa0
Update test-coverage
jabenninghoff 2662680
Add rdev 1.14.2 release notes
jabenninghoff d844455
renv::update()
jabenninghoff c19a246
Update notes on Positron adoption
jabenninghoff 29ac2c2
Add use_upkeep_issue() and upkeep_checklist()
jabenninghoff 9969041
Update TODO
jabenninghoff 501d204
Merge release notes
jabenninghoff 0839ed4
Fix copilot review items
jabenninghoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| YEAR: 2024 | ||
| YEAR: 2025 | ||
| COPYRIGHT HOLDER: John Benninghoff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| # workaround for ::: per https://stat.ethz.ch/pipermail/r-devel/2013-August/067210.html | ||
| `%:::%` <- function(pkg, fun) { | ||
| get(fun, | ||
| envir = asNamespace(pkg), | ||
| inherits = FALSE | ||
| ) | ||
| } | ||
|
|
||
| #' Create an upkeep checklist in a GitHub issue | ||
| #' | ||
| #' Opens an issue in the package repository with a checklist of tasks for regular maintenance and | ||
| #' adherence to rdev package standards. Some tasks are meant to be done only once, and others should | ||
| #' be reviewed periodically. Adapted from [usethis::use_upkeep_issue()] and | ||
| #' [usethis::use_tidy_upkeep_issue()]. | ||
| #' | ||
| #' @param last_upkeep Year of last upkeep. By default, the `Config/rdev/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. | ||
| #' | ||
| #' @export | ||
| use_upkeep_issue <- function(last_upkeep = last_upkeep_year()) { | ||
| checkmate::assert_integerish(last_upkeep, len = 1, null.ok = TRUE) | ||
|
|
||
| gh_repo <- get_github_repo() | ||
| checklist <- upkeep_checklist(last_upkeep = last_upkeep) | ||
| title_year <- format(Sys.Date(), "%Y") | ||
| project_name <- desc::desc_get_field("Package") | ||
|
|
||
| issue <- gh::gh( | ||
| "POST /repos/{owner}/{repo}/issues", | ||
| owner = gh_repo$username, | ||
| repo = gh_repo$repo, | ||
| title = glue::glue("Upkeep for {project_name} ({title_year})"), | ||
| body = paste0(checklist, "\n", collapse = "") | ||
| ) | ||
| Sys.sleep(1) | ||
| view_url(issue$html_url) | ||
|
|
||
| record_upkeep_date(Sys.Date()) | ||
| } | ||
|
|
||
| #' Create upkeep checklist | ||
| #' | ||
| #' Build an upkeep checklist following the format of [usethis::use_tidy_upkeep_issue()]. | ||
| #' | ||
| #' @param last_upkeep Year when upkeep was last performed. | ||
| #' | ||
| #' @return Upkeep checklist for current year as a GitHub markdown array. | ||
| #' | ||
| #' @export | ||
| upkeep_checklist <- function(last_upkeep = last_upkeep_year()) { | ||
| lic <- get_license() | ||
| ptype <- package_type() | ||
|
|
||
| bullets <- c( | ||
| "### New branch", | ||
| "", | ||
| todo('`rdev::new_branch("upkeep-{format(Sys.Date(), "%Y-%m")}")`'), | ||
| "" | ||
| ) | ||
|
|
||
| if (last_upkeep <= 2021) { | ||
| bullets <- c( | ||
| bullets, | ||
| "### Prehistory", | ||
| "", | ||
| todo("`usethis::use_roxygen_md()`"), | ||
| todo("`usethis::use_github_links()`"), | ||
| todo("`usethis::use_testthat(3)`"), | ||
| "" | ||
| ) | ||
| } | ||
| if (last_upkeep <= 2022) { | ||
| bullets <- c( | ||
| bullets, | ||
| "### 2022", | ||
| "", | ||
| todo("`rdev::use_spelling()`"), | ||
| todo("`rdev::use_codecov()`", length(fs::dir_ls("R")) > 1), | ||
| todo("Add `rdev.license.copyright` to `.Rprofile`", lic == "mit"), | ||
| "" | ||
| ) | ||
| } | ||
| if (last_upkeep <= 2023) { | ||
| bullets <- c( | ||
| bullets, | ||
| "### 2023", | ||
| "", | ||
| todo("`rdev::use_rprofile()`"), | ||
| todo("`setup-r`"), | ||
| "" | ||
| ) | ||
| } | ||
| if (last_upkeep <= 2024) { | ||
| bullets <- c( | ||
| bullets, | ||
| "### 2024", | ||
| "", | ||
| todo("`rdev::use_rdev_pkgdown()`", ptype == "rdev"), | ||
| todo("`rdev::use_analysis_package(use_quarto = FALSE)`", ptype == "analysis"), | ||
| "" | ||
| ) | ||
| } | ||
| if (last_upkeep <= 2025) { | ||
| bullets <- c( | ||
| bullets, | ||
| "### 2025", | ||
| "", | ||
| todo("`rdev::use_lintr()`"), | ||
| todo("`rdev::use_gitattributes()`"), | ||
| todo("`rdev::use_analysis_package(use_quarto = TRUE)`", ptype == "quarto"), | ||
| "" | ||
| ) | ||
| } | ||
|
|
||
| minimum_r_version <- pkg_minimum_r_version() | ||
| if (is.na(minimum_r_version) || "3.6.3" > minimum_r_version) minimum_r_version <- "3.6.3" | ||
| if (package_type() %in% c("analysis", "quarto") && "4.1.0" > minimum_r_version) { | ||
| minimum_r_version <- "4.1.0" | ||
| } | ||
| deps <- desc::desc_get_deps() | ||
| r_version <- deps[deps$package == "R", "version"] | ||
| r_version <- substr(r_version, 4, nchar(r_version)) | ||
| bullets <- c( | ||
| bullets, | ||
| "### Recurring tasks", | ||
| "", | ||
| todo( | ||
| "Consider changing default branch from `master` to `main`", | ||
| usethis::git_default_branch() == "master" | ||
| ), | ||
| todo( | ||
| '`usethis::use_package("R", "Depends", "{minimum_r_version}")`', | ||
| length(r_version) == 0 || minimum_r_version > r_version | ||
| ), | ||
| todo( | ||
| "Check for GitHub Action updates since {last_upkeep_date()}", | ||
| desc::desc_get_field("Package") == "rdev" | ||
| ), | ||
| todo("`rdev::use_rdev_package()`"), | ||
| todo("`build_quarto_site(unfreeze = TRUE)`", ptype == "quarto"), | ||
| todo( | ||
| '`usethis::use_mit_license(copyright_holder = getOption("rdev.license.copyright")`', | ||
| lic == "mit" | ||
| ), | ||
| todo( | ||
| '`usethis::use_proprietary_license(getOption("rdev.license.copyright"))`', | ||
| lic == "proprietary" | ||
| ), | ||
| todo( | ||
| "Update year in `inst/templates/`", | ||
| fs::dir_exists("inst/templates/") && length(fs::dir_ls("inst/templates/")) >= 1 | ||
| ), | ||
| todo( | ||
| "Update year in `inst/rmarkdown/templates`", | ||
| fs::dir_exists("inst/rmarkdown/templates") && | ||
| length(fs::dir_ls("inst/rmarkdown/templates")) >= 1 | ||
| ), | ||
| todo( | ||
| "Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for \\ | ||
| examples and https://pkgdown.r-lib.org/articles/accessibility.html for additional guidance." | ||
| ), | ||
| "" | ||
| ) | ||
| c(bullets, checklist_footer()) | ||
| } | ||
|
|
||
| # upkeep helpers | ||
|
|
||
| last_upkeep_date <- function() { | ||
| as.Date( | ||
| desc::desc_get_field("Config/rdev/last-upkeep", "2021-01-01"), | ||
| format = "%Y-%m-%d" | ||
| ) | ||
| } | ||
|
|
||
| last_upkeep_year <- function() { | ||
| as.integer(format(last_upkeep_date(), "%Y")) | ||
| } | ||
|
|
||
| record_upkeep_date <- function(date) { | ||
| desc::desc_set("Config/rdev/last-upkeep", format(date, "%Y-%m-%d"), normalize = TRUE) | ||
| } | ||
|
|
||
| todo <- function(x, cond = TRUE) { | ||
| x <- glue::glue(x, .envir = parent.frame()) | ||
| if (cond) { | ||
| paste0("- [ ] ", x) | ||
| } | ||
| } | ||
|
|
||
| pkg_minimum_r_version <- "usethis" %:::% "pkg_minimum_r_version" | ||
|
|
||
| checklist_footer <- function() { | ||
| glue::glue( | ||
| '<sup>\\ | ||
| Created on {Sys.Date()} with `rdev::use_upkeep_issue()`, using \\ | ||
| [rdev v{utils::packageVersion("rdev")}](https://jabenninghoff.github.io/rdev/)\\ | ||
| </sup>' | ||
| ) | ||
| } | ||
|
|
||
| view_url <- function(url, open = rlang::is_interactive()) { | ||
| if (open) utils::browseURL(url) | ||
| invisible(url) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.