To see the results, just print it to the screen.
Usage
gp(
path = ".",
checks = default_checks(),
extra_preps = NULL,
extra_checks = NULL,
quiet = TRUE
)Arguments
- path
Path to a package root.
- checks
Character vector, the checks to run. Defaults to
default_checks. Useall_checksto list all checks, or add optional sets liketidyverse_checks. WhenNULL, all registered checks are run, subject to any exclusions fromgoodpractice.exclude_prepsorGP_EXCLUDE_PREPS.- extra_preps
Custom preparation functions. See
make_prepon creating preparation functions.- extra_checks
Custom checks. See
make_checkon creating checks.- quiet
Whether to suppress output from the preparation functions. Note that not all preparation functions produce output, even if this option is set to
FALSE.
Value
A goodpractice object that you can query
with a simple API. See results to start.
Excluding check groups
When using the default checks = all_checks(), entire groups of
checks can be excluded by prep name via the
goodpractice.exclude_preps option or the GP_EXCLUDE_PREPS
environment variable (comma-separated). The option takes precedence.
# Skip URL and coverage checks:
options(goodpractice.exclude_preps = c("urlchecker", "covr"))
# Or via environment variable:
Sys.setenv(GP_EXCLUDE_PREPS = "urlchecker,covr")Exclusion only applies when checks = NULL (the default).
Explicit checks arguments are never filtered.
Examples
path <- system.file("bad1", package = "goodpractice")
# run a subset of all checks available
g <- gp(path, checks = all_checks()[3:16])
#> ℹ Preparing: description
#> ✔ Preparing: description [9ms]
#>
g
#> ── GP badpackage ───────────────────────────────────────────────────────────────
#>
#> It is good practice to
#>
#> ✖ not use "Depends" in DESCRIPTION, as it can cause name clashes, and poor
#> interaction with other packages. Use "Imports" instead.
#> ✖ omit "Date" in DESCRIPTION. It is not required and it gets invalid quite
#> often. A build date will be added to the package when you perform `R CMD
#> build` on it.
#> ✖ add a "URL" field to DESCRIPTION. It helps users find information about
#> your package online. If your package does not have a homepage, add an URL
#> to GitHub, or the CRAN package package page.
#> ✖ add a "BugReports" field to DESCRIPTION, and point it to a bug tracker.
#> Many online code hosting services provide bug trackers for free,
#> https://github.com, https://gitlab.com, etc.
#> ✖ add a README.md (or README.Rmd) file to the top-level directory. A good
#> README describes what the package does, how to install it, and includes a
#> short example.
#> ✖ add a NEWS.md file to track user-visible changes between releases. See
#> <https://style.tidyverse.org/news.html> for formatting guidance.
#> ✖ use the .R file extension for R scripts, not .r or .q. CRAN requires the
#> uppercase .R extension.
#>
#> R/bad_extension.r
#>
#> ────────────────────────────────────────────────────────────────────────────────
