Skip to content

Commit 7e9a3ea

Browse files
fix CRAN issues
1 parent b1ddf7a commit 7e9a3ea

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ editor_options:
88

99
- `parsable-R` hook now gives more context on where and how parsing
1010
fails (#423).
11+
- fixed R CMD check issues in devel
1112

1213
# precommit v0.3.1
1314

R/roxygen2.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ roxygen_assert_additional_dependencies <- function() {
105105
e
106106
}
107107
)
108-
if (inherits(out, "packageNotFoundError") || ("message" %in% names(out) && grepl("Dependency package(\\(s\\))? .* not available", out$message))) {
108+
if (
109+
inherits(out, "packageNotFoundError") ||
110+
("message" %in% names(out) && (
111+
grepl("Dependency package(\\(s\\))? .* not available", out$message) ||
112+
grepl("Failed to load", out$message)
113+
))
114+
) {
109115
# case used in package but not installed
110116
rlang::abort(paste0(
111117
"The roxygenize hook requires all dependencies of your package to be listed in ",

tests/testthat/test-hook-roxygenize.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test_that("asserting installed dependencies", {
8383
writeLines(generate_uninstalled_pkg_call(), "R/core.R")
8484
testthat::expect_error(
8585
roxygen_assert_additional_dependencies(),
86-
"requires all dependencies of your package"
86+
"there is no package called"
8787
)
8888
})
8989

@@ -125,7 +125,7 @@ test_that("fails gratefully when not installed package is called (packageNotFoun
125125
# when there is a missing package
126126
expect_error(
127127
roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize")),
128-
"Please add the package as a dependency"
128+
"there is no package called"
129129
)
130130
})
131131

@@ -139,7 +139,7 @@ test_that("fails gratefully when not installed package is required according to
139139
suppressWarnings(
140140
roxygenize_with_cache(list(getwd()), dirs = dirs_R.cache("roxygenize"))
141141
),
142-
"Please add the package"
142+
"The package .* is required"
143143
)
144144
})
145145

0 commit comments

Comments
 (0)