Skip to content

Commit b094e53

Browse files
committed
Fix R CMD check: qualify setNames, skip test when package.json excluded
1 parent 20037b8 commit b094e53

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎.Rbuildignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
^vignettes$
2222
^webpack\.config.*\.js$
2323
^\.claude$
24+
^\.positai$

‎R/backend-df.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ rbindFill <- function(dfs) {
406406
stateList[[k]] <- state[, allStateCols, drop = FALSE]
407407
} else {
408408
stateList[[k]] <- as.data.frame(
409-
setNames(replicate(length(allStateCols), rep(NA, n), simplify = FALSE), allStateCols),
409+
stats::setNames(replicate(length(allStateCols), rep(NA, n), simplify = FALSE), allStateCols),
410410
stringsAsFactors = FALSE
411411
)
412412
}

‎tests/testthat/test-reactable.R‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,8 +1396,11 @@ test_that("reactable.yaml widget dependencies are included with correct version.
13961396
})
13971397

13981398
test_that("duckdbDependency() version matches @duckdb/duckdb-wasm in package.json", {
1399-
skip_if_not_installed("jsonlite")
1400-
pkgJson <- jsonlite::fromJSON("../../package.json")
1399+
# package.json is excluded via .Rbuildignore, so this test only runs in the
1400+
# source tree (e.g., devtools::test()), not during R CMD check.
1401+
pkgJsonPath <- "../../package.json"
1402+
skip_if_not(file.exists(pkgJsonPath), message = "package.json not found (not in source tree)")
1403+
pkgJson <- jsonlite::fromJSON(pkgJsonPath)
14011404
npmVersion <- pkgJson$dependencies[["@duckdb/duckdb-wasm"]]
14021405
# Strip semver range prefix (^, ~) and prerelease suffix (-dev20.0, -beta.1, etc.)
14031406
baseVersion <- sub("^[~^]", "", npmVersion)

0 commit comments

Comments
 (0)