Skip to content

Commit

Permalink
Use NA when there's no minimum version stated for R
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Nov 20, 2024
1 parent c419e3c commit da18b7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,11 @@ author_has_rstudio_email <- function() {
pkg_minimum_r_version <- function() {
deps <- proj_desc()$get_deps()
r_dep <- deps[deps$package == "R" & deps$type == "Depends", "version"]
if (length(r_dep) == 0) {
return(numeric_version("0"))
if (length(r_dep) > 0) {
numeric_version(gsub("[^0-9.]", "", r_dep))
} else {
numeric_version(NA_character_)
}
numeric_version(gsub("[^0-9.]", "", r_dep))
}

# Borrowed from pak, but modified also retain user's non-cran repos:
Expand Down
3 changes: 2 additions & 1 deletion R/upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,15 @@ tidy_upkeep_checklist <- function(last_upkeep = last_upkeep_year(),
)
}

minimum_r_version <- pkg_minimum_r_version()
bullets <- c(
bullets,
"### To finish",
"",
todo("`usethis::use_mit_license()`", grepl("MIT", desc$get_field("License"))),
todo(
'`usethis::use_package("R", "Depends", "{tidy_minimum_r_version()}")`',
tidy_minimum_r_version() > pkg_minimum_r_version()
is.na(minimum_r_version) || tidy_minimum_r_version() > minimum_r_version
),
todo("`usethis::use_tidy_description()`"),
todo("`usethis::use_tidy_github_actions()`"),
Expand Down

0 comments on commit da18b7c

Please sign in to comment.