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

Polish upkeep bullets #1905

Merged
merged 14 commits into from
Oct 31, 2023
117 changes: 47 additions & 70 deletions R/upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ make_upkeep_issue <- function(year, tidy) {
}
}

checklist <- if (tidy) tidy_upkeep_checklist(year) else upkeep_checklist()
gh <- gh_tr(tr)
if (tidy) {
checklist <- tidy_upkeep_checklist(year, repo_spec = tr$repo_spec)
} else {
checklist <- upkeep_checklist()
}

title_year <- year %||% format(Sys.Date(), "%Y")

gh <- gh_tr(tr)
issue <- gh(
"POST /repos/{owner}/{repo}/issues",
title = glue("Upkeep for {project_name()} ({title_year})"),
body = paste0(checklist, "\n", collapse = "")
body = paste0(checklist, "\n", collapse = ""),
labels = if (tidy) list("upkeep")
)
Sys.sleep(1)
view_url(issue$html_url)
Expand Down Expand Up @@ -118,86 +123,56 @@ use_tidy_upkeep_issue <- function(year = NULL) {

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

bullets <- c()

if (year <= 2000) {
bullets <- c(
bullets,
"Pre-history",
"### Pre-history",
"",
todo("`usethis::use_readme_rmd()`"),
todo("`usethis::use_roxygen_md()`"),
todo("`usethis::use_github_links()`"),
todo("`usethis::use_pkgdown_github_pages()`"),
todo("`usethis::use_tidy_github_labels()`"),
todo("`usethis::use_tidy_style()`"),
todo("`usethis::use_tidy_description()`"),
todo("`urlchecker::url_check()`"),
""
)
}
if (year <= 2020) {
bullets <- c(
bullets,
"2020",
"### 2020",
"",
todo("
`usethis::use_package_doc()`
Consider letting usethis manage your `@importFrom` directives here.
`usethis::use_import_from()` is handy for this."),
todo("
`usethis::use_testthat(3)` and upgrade to 3e, \\
[testthat 3e vignette](https://testthat.r-lib.org/articles/third-edition.html)"),
todo("
Align the names of `R/` files and `test/` files for workflow happiness.
The docs for `usethis::use_r()` include a helpful script.
`usethis::rename_files()` may be be useful."),
todo("`usethis::use_package_doc()`"),
todo("`usethis::use_testthat(3)`"),
todo("Align the names of `R/` files and `test/` files"),
Comment on lines -147 to +154
Copy link
Member

Choose a reason for hiding this comment

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

In general, I like having detail, links, etc. But I can also imagine this is about making the items for the distant past more lean, yeah? And saving detail for the items we are more likely to be engaging with in the year of our lord 2023?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, exactly.

""
)
}
if (year <= 2021) {
bullets <- c(
bullets,
"2021",
"### 2021",
"",
todo("`usethis::use_tidy_description()`", year > 2000),
todo("`usethis::use_tidy_dependencies()`"),
todo("
`usethis::use_tidy_github_actions()` and update artisanal actions to \\
use `setup-r-dependencies`"),
todo("Remove check environments section from `cran-comments.md`"),
todo("Bump required R version in DESCRIPTION to {tidy_minimum_r_version()}"),
todo("
Use lifecycle instead of artisanal deprecation messages, as described \\
in [Communicate lifecycle changes in your functions](https://lifecycle.r-lib.org/articles/communicate.html)"),
todo(
'
Make sure RStudio appears in `Authors@R` of DESCRIPTION like so, if appropriate:
`person("RStudio", role = c("cph", "fnd"))`',
posit_pkg && !posit_person_ok
),
todo("Use lifecycle instead of artisanal deprecation messages"),
""
)
}
if (year <= 2022) {
bullets <- c(
bullets,
"2022",
"### 2022",
"",
todo("`usethis::use_tidy_coc()`"),
todo("Handle and close any still-open `master` --> `main` issues"),
todo("Update README badges, instructions in [r-lib/usethis#1594](https://github.com/r-lib/usethis/issues/1594)"),
todo("
Update errors to rlang 1.0.0. Helpful guides:
<https://rlang.r-lib.org/reference/topic-error-call.html>
<https://rlang.r-lib.org/reference/topic-error-chaining.html>
<https://rlang.r-lib.org/reference/topic-condition-formatting.html>"),
todo('`usethis:::use_codecov_badge("{repo_spec}")`'),
todo("Update pkgdown site using instructions at <https://tidytemplate.tidyverse.org>"),
todo("Ensure pkgdown `development` is `mode: auto` in pkgdown config"),
todo("Re-publish released site; see [How to update a released site](https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html)"),
todo("Update lifecycle badges with more accessible SVGs: `usethis::use_lifecycle()`"),
""
)
Expand All @@ -208,64 +183,66 @@ tidy_upkeep_checklist <- function(year = NULL,

bullets <- c(
bullets,
"2023",
"",
"Necessary:",
"### 2023",
"",
todo(
"Update email addresses *@rstudio.com -> *@posit.co",
"
Update email addresses *@rstudio.com -> *@posit.co",
author_has_rstudio_email()
),
todo(
'
Update copyright holder in DESCRIPTION: \\
`person(given = "Posit Software, PBC", role = c("cph", "fnd"))`',
`person("Posit Software, PBC", role = c("cph", "fnd"))`',
posit_pkg && !posit_person_ok
),
todo(
"
`Run devtools::document()` to re-generate package-level help topic \\
Run `devtools::document()` to re-generate package-level help topic \\
with DESCRIPTION changes",
author_has_rstudio_email() || (posit_pkg && !posit_person_ok)
),
todo(
"
Double check license file uses '[package] authors' \\
as copyright holder. Run `use_mit_license()`",
grepl("MIT", desc$get_field("License"))
),
todo("
Update logo (https://github.com/rstudio/hex-stickers); \\
run `use_tidy_logo()`"),
todo("`usethis::use_tidy_logo()`"),
todo("`usethis::use_tidy_coc()`"),
todo(
"Modernize citation files; see updated `use_citation()`",
has_citation_file()
),
todo("`usethis::use_tidy_github_actions()`"),
"",
"Optional:",
"",
todo("Review 2022 checklist to see if you completed the pkgdown updates"),
todo('Prefer `pak::pak("org/pkg")` over `devtools::install_github("org/pkg")` in README'),
todo('Use `pak::pak("{repo_spec}")` in README'),
todo("
Consider running `use_tidy_dependencies()` and/or \\
Consider running `usethis::use_tidy_dependencies()` and/or \\
replace compat files with `use_standalone()`"),
todo("Use cli errors or [file an issue](new) if you don\'t have time to do it now"),
todo('
`use_standalone("r-lib/rlang", "types-check")` \\
instead of home grown argument checkers'),
`usethis::use_standalone("r-lib/rlang", "types-check")` \\
instead of home grown argument checkers;
or [file an issue](new) if you don\'t have time to do it now'),
todo(
"
Change files ending in `.r` to `.R` in R/ and/or tests/testthat/",
Change files ending in `.r` to `.R` in `R/` and/or `tests/testthat/`",
lowercase_r()
),
todo("
Add alt-text to pictures, plots, etc; see \\
https://posit.co/blog/knitr-fig-alt/ for examples"),
https://posit.co/blog/knitr-fig-alt/ for examples"
),
""
)
}

bullets <- c(
bullets,
"### Eternal",
"",
todo("`usethis::use_mit_license()`", grepl("MIT", desc$get_field("License"))),
todo('`usethis::use_package("R", "Depends", "{tidy_minimum_r_version()}")`'),
todo("`usethis::use_tidy_description()`"),
todo("`usethis::use_tidy_github_actions()`"),
todo("`devtools::build_readme()`"),
todo("[Re-publish released site](https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html) if needed"),
""
)

c(bullets, checklist_footer(tidy = TRUE))
}

Expand Down
64 changes: 25 additions & 39 deletions tests/testthat/_snaps/upkeep.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,56 @@
Code
writeLines(tidy_upkeep_checklist(posit_pkg = TRUE, posit_person_ok = FALSE))
Output
Pre-history
### Pre-history

* [ ] `usethis::use_readme_rmd()`
* [ ] `usethis::use_roxygen_md()`
* [ ] `usethis::use_github_links()`
* [ ] `usethis::use_pkgdown_github_pages()`
* [ ] `usethis::use_tidy_github_labels()`
* [ ] `usethis::use_tidy_style()`
* [ ] `usethis::use_tidy_description()`
* [ ] `urlchecker::url_check()`

2020
### 2020

* [ ] `usethis::use_package_doc()`
Consider letting usethis manage your `@importFrom` directives here.
`usethis::use_import_from()` is handy for this.
* [ ] `usethis::use_testthat(3)` and upgrade to 3e, [testthat 3e vignette](https://testthat.r-lib.org/articles/third-edition.html)
* [ ] Align the names of `R/` files and `test/` files for workflow happiness.
The docs for `usethis::use_r()` include a helpful script.
`usethis::rename_files()` may be be useful.
* [ ] `usethis::use_testthat(3)`
* [ ] Align the names of `R/` files and `test/` files

2021
### 2021

* [ ] `usethis::use_tidy_dependencies()`
* [ ] `usethis::use_tidy_github_actions()` and update artisanal actions to use `setup-r-dependencies`
* [ ] Remove check environments section from `cran-comments.md`
* [ ] Bump required R version in DESCRIPTION to 3.6
* [ ] Use lifecycle instead of artisanal deprecation messages, as described in [Communicate lifecycle changes in your functions](https://lifecycle.r-lib.org/articles/communicate.html)
* [ ] Make sure RStudio appears in `Authors@R` of DESCRIPTION like so, if appropriate:
`person("RStudio", role = c("cph", "fnd"))`
* [ ] Use lifecycle instead of artisanal deprecation messages

2022
### 2022

* [ ] `usethis::use_tidy_coc()`
* [ ] Handle and close any still-open `master` --> `main` issues
* [ ] Update README badges, instructions in [r-lib/usethis#1594](https://github.com/r-lib/usethis/issues/1594)
* [ ] Update errors to rlang 1.0.0. Helpful guides:
<https://rlang.r-lib.org/reference/topic-error-call.html>
<https://rlang.r-lib.org/reference/topic-error-chaining.html>
<https://rlang.r-lib.org/reference/topic-condition-formatting.html>
* [ ] `usethis:::use_codecov_badge("OWNER/REPO")`
* [ ] Update pkgdown site using instructions at <https://tidytemplate.tidyverse.org>
* [ ] Ensure pkgdown `development` is `mode: auto` in pkgdown config
* [ ] Re-publish released site; see [How to update a released site](https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html)
* [ ] Update lifecycle badges with more accessible SVGs: `usethis::use_lifecycle()`

2023

Necessary:
### 2023

* [ ] Update email addresses *@rstudio.com -> *@posit.co
* [ ] Update copyright holder in DESCRIPTION: `person(given = "Posit Software, PBC", role = c("cph", "fnd"))`
* [ ] `Run devtools::document()` to re-generate package-level help topic with DESCRIPTION changes
* [ ] Double check license file uses '[package] authors' as copyright holder. Run `use_mit_license()`
* [ ] Update logo (https://github.com/rstudio/hex-stickers); run `use_tidy_logo()`
* [ ] 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_coc()`
* [ ] `usethis::use_tidy_github_actions()`
* [ ] Use `pak::pak("OWNER/REPO")` in README
* [ ] Consider running `usethis::use_tidy_dependencies()` and/or replace compat files with `use_standalone()`
* [ ] Use cli errors or [file an issue](new) if you don't have time to do it now
* [ ] `usethis::use_standalone("r-lib/rlang", "types-check")` instead of home grown argument checkers;
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

Optional:
### Eternal
Copy link
Member

Choose a reason for hiding this comment

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

Good idea 💡


* [ ] Review 2022 checklist to see if you completed the pkgdown updates
* [ ] Prefer `pak::pak("org/pkg")` over `devtools::install_github("org/pkg")` in README
* [ ] Consider running `use_tidy_dependencies()` and/or replace compat files with `use_standalone()`
* [ ] `use_standalone("r-lib/rlang", "types-check")` instead of home grown argument checkers
* [ ] Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples
* [ ] `usethis::use_mit_license()`
* [ ] `usethis::use_package("R", "Depends", "3.6")`
* [ ] `usethis::use_tidy_description()`
* [ ] `usethis::use_tidy_github_actions()`
* [ ] `devtools::build_readme()`
* [ ] [Re-publish released site](https://pkgdown.r-lib.org/dev/articles/how-to-update-released-site.html) if needed

<sup>Created on DATE with `usethis::use_tidy_upkeep_issue()`, using [usethis vVERSION](https://usethis.r-lib.org)</sup>

Expand Down
Loading