Skip to contents

Add an error and warning management around devtools::install_dev_deps call. Useful for any R CI.

Usage

installDepsWithErrManagementCi(
  doUpgrades = TRUE,
  warningsAsErrors = FALSE,
  printAllMessages = TRUE,
  instDevDeps = 1,
  repo = "https://cloud.r-project.org",
  useCiOptions = 1,
  errorExpected = 0
)

Arguments

doUpgrades

TRUE to pass "always" to sub-function, this force upgrade of dependencies. FALSE to pass "never" to sub-function, dependencies will never be upgraded.

warningsAsErrors

Boolean, TRUE to manage warnings and errors as errors. FALSE to manage only errors as errors.

printAllMessages

Boolean, TRUE to print all messages printed by devtools::install_dev_deps

instDevDeps

1 (default) to install also development dependencies ("Suggests") other values to install only "Depends", "Imports" and "LinkingTo"

repo

The repository used to download packages

useCiOptions

1 (default) to use CI options as defined in optionsForCi.R, other values to not use them

errorExpected

0 (default) to expect this function run fine, other values to expect an error (useful for tests)

Value

NULL (instead this function raise an error or not)

Examples

if (FALSE) {
    citoolsr::installDepsWithErrManagementCi(
        doUpgrades = TRUE,
        warningsAsErrors = TRUE,
        printAllMessages = TRUE)
}