Skip to content
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

More upkeep polishing #1909

Merged
merged 5 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions R/release.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ release_checklist <- function(version, on_cran) {
Check if any deprecation processes should be advanced, as described in \\
[Gradual deprecation](https://lifecycle.r-lib.org/articles/communicate.html#gradual-deprecation)",
type != "patch" && has_lifecycle),
todo("Bump required R version in DESCRIPTION to {tidy_min_r_version}",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now in upkeep, rather than release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda like it as part of the release checklist, but not a hill I will die on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong feelings either except that it should be in one or the other.

is_posit_pkg && tidy_min_r_version > pkg_minimum_r_version()),
todo("`usethis::use_news_md()`", on_cran && !has_news),
todo("[Polish NEWS](https://style.tidyverse.org/news.html#news-release)", on_cran),
todo("`usethis::use_github_links()`", !has_github_links),
Expand Down
14 changes: 11 additions & 3 deletions R/upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,21 @@ use_tidy_upkeep_issue <- function(year = NULL) {
make_upkeep_issue(year = year, tidy = TRUE)
}

# for mocking
Sys.Date <- NULL

tidy_upkeep_checklist <- function(year = NULL,
posit_pkg = is_posit_pkg(),
posit_person_ok = is_posit_person_canonical(),
repo_spec = "OWNER/REPO") {
year <- year %||% 2000

bullets <- c()
bullets <- c(
"### To begin",
"",
todo('`pr_init("upkeep-{format(Sys.Date(), "%Y-%m")}")`'),
""
)

if (year <= 2000) {
bullets <- c(
Expand Down Expand Up @@ -202,7 +210,7 @@ tidy_upkeep_checklist <- function(year = NULL,
with DESCRIPTION changes",
author_has_rstudio_email() || (posit_pkg && !posit_person_ok)
),
todo("`usethis::use_tidy_logo()`"),
todo("`usethis::use_tidy_logo(); pkgdown::build_favicons(overwrite = TRUE)`"),
todo("`usethis::use_tidy_coc()`"),
todo(
"Modernize citation files; see updated `use_citation()`",
Expand Down Expand Up @@ -232,7 +240,7 @@ tidy_upkeep_checklist <- function(year = NULL,

bullets <- c(
bullets,
"### Eternal",
"### To finish",
"",
todo("`usethis::use_mit_license()`", grepl("MIT", desc$get_field("License"))),
todo('`usethis::use_package("R", "Depends", "{tidy_minimum_r_version()}")`'),
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/_snaps/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@

* [ ] `git pull`
* [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_{TESTPKG}.html)
* [ ] Bump required R version in DESCRIPTION to 3.6
* [ ] `usethis::use_news_md()`
* [ ] [Polish NEWS](https://style.tidyverse.org/news.html#news-release)
* [ ] `usethis::use_github_links()`
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/_snaps/upkeep.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Code
writeLines(tidy_upkeep_checklist(posit_pkg = TRUE, posit_person_ok = FALSE))
Output
### To begin

* [ ] `pr_init("upkeep-2023-01")`

### Pre-history

* [ ] `usethis::use_readme_rmd()`
Expand Down Expand Up @@ -36,7 +40,7 @@
* [ ] Update email addresses *@rstudio.com -> *@posit.co
* [ ] Update copyright holder in DESCRIPTION: `person("Posit Software, PBC", role = c("cph", "fnd"))`
* [ ] Run `devtools::document()` to re-generate package-level help topic with DESCRIPTION changes
* [ ] `usethis::use_tidy_logo()`
* [ ] `usethis::use_tidy_logo(); pkgdown::build_favicons(overwrite = TRUE)`
* [ ] `usethis::use_tidy_coc()`
* [ ] Use `pak::pak("OWNER/REPO")` in README
* [ ] Consider running `usethis::use_tidy_dependencies()` and/or replace compat files with `use_standalone()`
Expand All @@ -45,7 +49,7 @@
or [file an issue](new) if you don't have time to do it now
* [ ] Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples

### Eternal
### To finish

* [ ] `usethis::use_mit_license()`
* [ ] `usethis::use_package("R", "Depends", "3.6")`
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ test_that("tidy upkeep bullets don't change accidentally", {
License = "MIT + file LICENSE"
)
)
local_mocked_bindings(Sys.Date = function() as.Date("2023-01-01"))

create_local_package()

expect_snapshot(
Expand All @@ -34,7 +36,7 @@ test_that("upkeep bullets don't change accidentally",{
use_testthat()
withr::local_file("cran-comments.md")
writeLines(
"## Test environments\\n\\n* local Ubuntu\\n\\# R CMD check results\\n",
"## Test environments\\n\\n* local Ubuntu\\n\\# R CMD check results\\n",
"cran-comments.md"
)
local_mocked_bindings(git_default_branch = function() "master")
Expand Down
Loading