Skip to contents

Learn more about what dev_check() does.

Usage

dev_lint()

dev_document()

dev_spell_check()

dev_build_site()

dev_publish_vignettes()

dev_coverage(file = NULL)

Arguments

file

passed to covr::file_report(), optional. See Details.

Value

Each function returns TRUE invisibly upon success.

Details

dev_check() is a convenience wrapper that runs the following checks in sequence:

Spell checking

dev_spell_check() first checks package documentation and vignettes for spelling errors. If no spelling errors are found, the custom dictionary is re-sorted, deduplicated, and purged of unused words. If spelling errors are found, a user confirmation is required before updating the custom dictionary; otherwise an error is thrown.

About vignettes-raw

pkgdown::build_site() generates a documentation site for your package, including an "Articles" section that contains rendered package vignettes. This works great for simple demos, but pkgdown::build_site() re-renders every R Markdown vignette when building the site, making it impractical for long-running vignettes or when code requires specific resources. This function introduces the concept of a vignettes-raw subdirectory as a place for notebooks and R Markdown documents that are only run manually.

To enable this feature, simply render R Markdown documents in vignettes-raw with keep_md: true. When you are ready to "publish", simply check in the rendered *.md file (plus any supporting files) into source control.

dev_publish_vignettes() employs a simple hack to add these documents to the package site without re-rendering. Briefly, the vignettes-raw directory is copied into the vignettes directory, and some name changes are applied so pkgdown::build_site() uses the (pre-rendered) Markdown file, rather than the source R Markdown file.

Coverage reports

If a file is specified, a coverage report will be generated for that file. If a file is not specified, and package coverage is less than 100%, then the a report will be generated for the file with the least coverage. A package coverage summary is printed to the console, and if a file report is generated, it is previewed in the RStudio Viewer pane.