Used in gDR platform pacakges' CI/CD pipelines to check that the package
abides by gDRstyle stylistic requirements, passes rcmdcheck
, and
ensures that the dependencies.yml
file used to build
gDR platform's docker image is kept up-to-date with the dependencies
listed in the package's DESCRIPTION
file.
Usage
checkPackage(
pkgName,
repoDir,
subdir = NULL,
fail_on = "warning",
bioc_check = FALSE,
run_examples = TRUE,
skip_lint = FALSE,
skip_tests = FALSE,
skip_pkgdown = FALSE,
build_vignettes = TRUE,
check_vignettes = TRUE,
as_cran = FALSE
)
Arguments
- pkgName
String of package name.
- repoDir
String of path to repository directory.
- subdir
String of relative path to the R package root directory from the
repoDir
.- fail_on
String specifying the level at which check fail. Supported values:
"note"
,"warning"
(default) and"error"
.- bioc_check
Logical whether bioc check should be performed
- run_examples
Logical whether examples check should be performed
- skip_lint
skip lint checks
- skip_tests
skip tests
- skip_pkgdown
skip pkgdown build
- build_vignettes
build vignettes
- check_vignettes
check vignettes
- as_cran
run with as_cran flag
Examples
checkPackage(
pkgName = "fakePkg",
repoDir = system.file(package = "gDRstyle", "tst_pkgs", "dummy_pkg"),
fail_on = "error"
)
#> Lint
#> ##------ Fri Aug 22 08:59:32 2025 ------##
#> Linting file: /usr/local/lib/R/site-library/gDRstyle/tst_pkgs/dummy_pkg/R/test.R
#> Linting file: /usr/local/lib/R/site-library/gDRstyle/tst_pkgs/dummy_pkg/tests/testthat.R
#> Linting file: /usr/local/lib/R/site-library/gDRstyle/tst_pkgs/dummy_pkg/tests/testthat/test-pkg.R
#> All files OK!
#> Tests
#> ##------ Fri Aug 22 08:59:32 2025 ------##
#> ✔ | F W S OK | Context
#>
#> ⠏ | 0 | pkg
#> ⠋ | 1 | pkg
#> ✔ | 1 | pkg
#>
#> ══ Results ═════════════════════════════════════════════════════════════════════
#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ]
#>
#> Way to go!
#> Pkgdown
#> -- Building function reference -------------------------------------------------
#> Writing 'reference/index.html'
#> Error in rlang::env_unlock(ns): `env_unlock()` is defunct as of rlang 1.1.5
#> ℹ This error is likely caused by an outdated version of pkgload. You are
#> running pkgload 1.3.4 and you need at least 1.4.0