Appends a curated set of common files and directories to .Rbuildignore
to exclude them from R package builds. This supplements the auto-generated
.Rbuildignore created by usethis::create_package().
Already-present patterns are silently skipped. The curated set covers: R build artifacts, Git files, IDE/dev tool directories, CI/CD config, documentation build artifacts, CRAN/development files, and other common files that should not be shipped with a package.
Usage
add_global_rbuildignore(
...,
pattern = GLOBAL_RBUILDIGNORE_PATTERN,
replace_default = FALSE,
path = NULL
)Arguments
- ...
Additional regex patterns (character strings) to add beyond the selected patterns. Each must already be in
.Rbuildignoreregex format (e.g."^\\.myfile$").- pattern
Character vector of
.Rbuildignorepatterns. By default, uses GLOBAL_RBUILDIGNORE_PATTERN.- replace_default
Logical. If
FALSE(the default),patternis appended to GLOBAL_RBUILDIGNORE_PATTERN. IfTRUE,patternis used instead of the defaults.- path
Character. Path to the package root directory. If
NULL(the default), uses the current working directory.
Examples
if (FALSE) { # \dontrun{
add_global_rbuildignore()
# With additional custom patterns
add_global_rbuildignore("^\\.myconfig$", "^data-raw$")
# Use only a custom pattern set
add_global_rbuildignore(
pattern = c("^\\.github$", "^docs$"),
replace_default = TRUE
)
} # }
