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
#> ##------ Wed May 28 00:52:06 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
#> ##------ Wed May 28 00:52:06 2025 ------##
#> ✔ | F W S OK | Context
#>
#> ⠏ | 0 | pkg
#> ✔ | 1 | pkg
#>
#> ══ Results ═════════════════════════════════════════════════════════════════════
#> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ]
#>
#> Way to go!
#> Pkgdown
#> -- Installing package into temporary library -----------------------------------
#> == Building pkgdown site =======================================================
#> Reading from: '/usr/local/lib/R/site-library/gDRstyle/tst_pkgs/dummy_pkg'
#> Writing to: '/tmp/RtmpAlG4cE/file14a453245'
#> -- Initialising site -----------------------------------------------------------
#> Copying '../../../pkgdown/BS3/assets/bootstrap-toc.css' to 'bootstrap-toc.css'
#> Copying '../../../pkgdown/BS3/assets/bootstrap-toc.js' to 'bootstrap-toc.js'
#> Copying '../../../pkgdown/BS3/assets/docsearch.css' to 'docsearch.css'
#> Copying '../../../pkgdown/BS3/assets/docsearch.js' to 'docsearch.js'
#> Copying '../../../pkgdown/BS3/assets/link.svg' to 'link.svg'
#> Copying '../../../pkgdown/BS3/assets/pkgdown.css' to 'pkgdown.css'
#> Copying '../../../pkgdown/BS3/assets/pkgdown.js' to 'pkgdown.js'
#> -- Building home ---------------------------------------------------------------
#> Writing 'authors.html'
#> Writing '404.html'
#> -- Building function reference -------------------------------------------------
#> Writing 'reference/index.html'
#> Reading 'man/tstCharLimitLintr.Rd'
#> Writing 'reference/tstCharLimitLintr.html'
#> Writing 'sitemap.xml'
#> == DONE ========================================================================
#> Check
#> ##------ Wed May 28 00:52:09 2025 ------##
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> pdflatex not found! Not building PDF manual.
#> * checking for file ‘.../DESCRIPTION’ ... OK
#> * preparing ‘fakePkg’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘fakePkg_1.0.tar.gz’
#>
#> ── R CMD check ─────────────────────────────────────────────────────────────────
#> * using log directory ‘/tmp/RtmpAlG4cE/file126b9bea0/fakePkg.Rcheck’
#> * using R version 4.3.0 (2023-04-21)
#> * using platform: x86_64-pc-linux-gnu (64-bit)
#> * R was compiled by
#> gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
#> GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
#> * running under: Ubuntu 22.04.3 LTS
#> * using session charset: UTF-8
#> * using options ‘--no-tests --no-manual’
#> * checking for file ‘fakePkg/DESCRIPTION’ ... OK
#> * checking extension type ... Package
#> * this is package ‘fakePkg’ version ‘1.0’
#> * checking package namespace information ... OK
#> * checking package dependencies ... OK
#> * checking if this is a source package ... OK
#> * checking if there is a namespace ... OK
#> * checking for executable files ... OK
#> * checking for hidden files and directories ... OK
#> * checking for portable file names ... OK
#> * checking for sufficient/correct file permissions ... OK
#> * checking whether package ‘fakePkg’ can be installed ... OK
#> * checking installed package size ... OK
#> * checking package directory ... OK
#> * checking DESCRIPTION meta-information ... NOTE
#> Malformed Description field: should contain one or more complete sentences.
#> Non-standard license specification:
#> What license is it under?
#> Standardizable: FALSE
#> * checking top-level files ... OK
#> * checking for left-over files ... OK
#> * checking index information ... OK
#> * checking package subdirectories ... OK
#> * checking R files for non-ASCII characters ... OK
#> * checking R files for syntax errors ... OK
#> * checking whether the package can be loaded ... OK
#> * checking whether the package can be loaded with stated dependencies ... OK
#> * checking whether the package can be unloaded cleanly ... OK
#> * checking whether the namespace can be loaded with stated dependencies ... OK
#> * checking whether the namespace can be unloaded cleanly ... OK
#> * checking loading without being on the library search path ... OK
#> * checking dependencies in R code ... OK
#> * checking S3 generic/method consistency ... OK
#> * checking replacement functions ... OK
#> * checking foreign function calls ... OK
#> * checking R code for possible problems ... OK
#> * checking Rd files ... OK
#> * checking Rd metadata ... OK
#> * checking Rd cross-references ... OK
#> * checking for missing documentation entries ... OK
#> * checking for code/documentation mismatches ... OK
#> * checking Rd \usage sections ... OK
#> * checking Rd contents ... OK
#> * checking for unstated dependencies in examples ... OK
#> * checking examples ... NONE
#> * checking for unstated dependencies in ‘tests’ ... OK
#> * checking tests ... SKIPPED
#> * DONE
#>
#> Status: 1 NOTE
#> See
#> ‘/tmp/RtmpAlG4cE/file126b9bea0/fakePkg.Rcheck/00check.log’
#> for details.
#>
#> Finished
#> ##------ Wed May 28 00:52:20 2025 ------##