% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gp.R
\name{gp}
\alias{gp}
\alias{goodpractice}
\title{Run good practice checks}
\usage{
gp(
  path = ".",
  checks = default_checks(),
  extra_preps = NULL,
  extra_checks = NULL,
  quiet = TRUE
)
}
\arguments{
\item{path}{Path to a package root.}

\item{checks}{Character vector, the checks to run. Defaults to
\code{\link{default_checks}}. Use \code{\link{all_checks}} to list all
checks, or add optional sets like \code{\link{tidyverse_checks}}.
When \code{NULL}, all registered checks are run, subject to any
exclusions from \code{goodpractice.exclude_check_groups} or
\code{GP_EXCLUDE_CHECK_GROUPS}.}

\item{extra_preps}{Custom preparation functions. See
\code{\link{make_prep}} on creating preparation functions.}

\item{extra_checks}{Custom checks. See \code{\link{make_check}} on
creating checks.}

\item{quiet}{Whether to suppress output from the preparation
functions. Note that not all preparation functions produce output,
even if this option is set to \code{FALSE}.}
}
\value{
A goodpractice object that you can query
with a simple API. See \code{\link{results}} to start.
}
\description{
To see the results, just print it to the screen.
}
\section{Excluding check groups}{

When using the default \code{checks = all_checks()}, entire groups of
checks can be excluded by group name via the
\code{goodpractice.exclude_check_groups} option or the
\code{GP_EXCLUDE_CHECK_GROUPS} environment variable (comma-separated).
The option takes precedence.

\preformatted{
# Skip URL and coverage checks:
options(goodpractice.exclude_check_groups = c("urlchecker", "covr"))

# Or via environment variable:
Sys.setenv(GP_EXCLUDE_CHECK_GROUPS = "urlchecker,covr")
}

Exclusion only applies when \code{checks = NULL} (the default).
Explicit \code{checks} arguments are never filtered.
}

\section{Excluding files}{

Specific files can be excluded from checks via the
\code{goodpractice.exclude_path} option or the \code{GP_EXCLUDE_PATH}
environment variable (comma-separated). Paths are relative to the
package root.

\preformatted{
options(goodpractice.exclude_path = c("R/RcppExports.R", "R/generated.R"))

# Or via environment variable:
Sys.setenv(GP_EXCLUDE_PATH = "R/RcppExports.R,R/generated.R")
}

Excluded files are skipped by lintr, treesitter, expression, and
roxygen2 checks.
}

\section{Parallel preparation}{

Preparation steps run sequentially by default. To run them in
parallel, install \pkg{future.apply} and set a
\code{\link[future]{plan}}:

\preformatted{
future::plan("multisession")
gp(".")
}

Preps run in parallel only when a non-sequential plan is active.
Prep functions must be independent: in parallel mode each prep
receives the initial state snapshot, so a prep cannot read another
prep's output. Only new state fields are merged back; if two preps
write the same field, the second is dropped with a warning.
}

\examples{
path <- system.file("bad1", package = "goodpractice")
# Run a subset of all checks available
g <- gp(path, checks = all_checks()[9:16])
g
# Or run with named check groups
g <- gp(path, checks = checks_by_group("description", "namespace"))
}
\seealso{
Other main:
\code{\link{goodpractice-package}}
}
\concept{main}
