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

Provide way to register extra packages for revdep checks #1745

Merged
merged 6 commits into from
Jan 24, 2023
Merged

Conversation

hadley
Copy link
Member

@hadley hadley commented Jan 19, 2023

Requires r-lib/revdepcheck#352 to work

Fixes #1610

R/release.R Outdated Show resolved Hide resolved
R/release.R Outdated Show resolved Hide resolved
R/release.R Outdated Show resolved Hide resolved
R/release.R Outdated Show resolved Hide resolved

if (is_rstudio_pkg) {
if (length(extra) > 1) {
extra_code <- paste0(deparse(extra), collapse = "")
Copy link
Member

Choose a reason for hiding this comment

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

I had to run this locally to figure out what it did 😅

Copy link
Member

Choose a reason for hiding this comment

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

Can it just be deparse(extra)?

extra <- letters[1:3]
identical(deparse(extra), paste0(deparse(extra), collapse = ""))
#> [1] TRUE

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably would be fine here, but it's safer to always collapse into a single string:

extra <- paste0("longpackagename", letters[1:10])
length(deparse(extra))
#> [1] 3

Created on 2023-01-24 with reprex v2.0.2


test_that("construct correct revdep bullet", {
create_local_package()
env <- env(release_extra_revdeps = function() c("waldo", "testthat"))
Copy link
Member

Choose a reason for hiding this comment

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

I assume this would have failed to give the right answer if it returned 1 character string instead of 2 because of that length() > 1 bug 😬

R/release.R Show resolved Hide resolved
R/release.R Outdated Show resolved Hide resolved

if (is_rstudio_pkg) {
if (length(extra) > 1) {
extra_code <- paste0(deparse(extra), collapse = "")
Copy link
Member

Choose a reason for hiding this comment

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

Can it just be deparse(extra)?

extra <- letters[1:3]
identical(deparse(extra), paste0(deparse(extra), collapse = ""))
#> [1] TRUE

@hadley hadley merged commit 5ebd15a into main Jan 24, 2023
@hadley hadley deleted the extra-revdeps branch January 24, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customise list of packages in revdep check in use_release_issue()
4 participants