ropensci-review-tools / goodpractice

Advice on R Package Building
https://docs.ropensci.org/goodpractice/
Other
465 stars 37 forks source link

fix #135 : ensure `||` receives scalar logicals #136

Closed russHyde closed 5 years ago

russHyde commented 5 years ago

A bug in check_passed was revealed while running goodpractice tests with the experimental env variable "_R_CHECK_LENGTH_1LOGIC2" = TRUE in R 3.6 (or during devtools::check()).

The chk variable passed to check_passed can be of two forms:

The scalar (first case) or the status entry indicates whether the check passed

is.na(chk) || ("status" %in% names(chk) && is.na(chk[["status"]]))

caused the list-form of chk to throw the above error.

We now extract the status indicator from chk before running the logical tests to see if the corresponding checking function failed. This cleaned up the stream of logical tests.

russHyde commented 5 years ago

Note that the contents of this PR have been discussed with @gaborcsardi in issue #135

russHyde commented 5 years ago

Hi @gaborcsardi and @hfrick , I was wondering whether one of you might be able to look at this PR.

gaborcsardi commented 5 years ago

Looks good, thanks much! Sorry for the delay!

russHyde commented 5 years ago

Cheers