rcmdcheck/ 0000755 0001762 0000144 00000000000 14124357312 012177 5 ustar ligges users rcmdcheck/NAMESPACE 0000644 0001762 0000144 00000002447 14123056601 013421 0 ustar ligges users # Generated by roxygen2: do not edit by hand
S3method(as.data.frame,rcmdcheck)
S3method(print,rcmdcheck)
S3method(print,rcmdcheck_comparison)
S3method(print,rcmdcheck_comparison_summary)
S3method(summary,rcmdcheck)
S3method(summary,rcmdcheck_comparison)
S3method(xopen,rcmdcheck)
export(check_details)
export(compare_checks)
export(compare_to_cran)
export(cran_check_flavours)
export(cran_check_results)
export(parse_check)
export(parse_check_url)
export(rcmdcheck)
export(rcmdcheck_process)
importFrom(R6,R6Class)
importFrom(callr,rcmd_process)
importFrom(callr,rcmd_process_options)
importFrom(callr,rcmd_safe)
importFrom(cli,cli_progress_bar)
importFrom(cli,cli_progress_update)
importFrom(cli,is_dynamic_tty)
importFrom(cli,symbol)
importFrom(curl,handle_setopt)
importFrom(curl,multi_add)
importFrom(curl,multi_cancel)
importFrom(curl,multi_list)
importFrom(curl,multi_run)
importFrom(curl,new_handle)
importFrom(curl,new_pool)
importFrom(desc,desc)
importFrom(desc,description)
importFrom(digest,digest)
importFrom(pkgbuild,pkgbuild_process)
importFrom(prettyunits,pretty_dt)
importFrom(prettyunits,pretty_sec)
importFrom(rprojroot,find_package_root_file)
importFrom(utils,head)
importFrom(utils,tail)
importFrom(withr,local_path)
importFrom(withr,with_dir)
importFrom(withr,with_envvar)
importFrom(xopen,xopen)
rcmdcheck/LICENSE 0000644 0001762 0000144 00000000113 13142421221 013165 0 ustar ligges users YEAR: 2016-2017
COPYRIGHT HOLDER: Mango Solutions, Gábor Csárdi, RStudio
rcmdcheck/README.md 0000644 0001762 0000144 00000041524 14123052353 013460 0 ustar ligges users Run R CMD check from R and Capture Results
================
- [rcmdcheck](#rcmdcheck)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
# rcmdcheck
> Run R CMD check from R and Capture Results
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://github.com/r-lib/rcmdcheck/actions)
[](https://www.r-pkg.org/pkg/rcmdcheck)
[](https://www.r-pkg.org/pkg/rcmdcheck)
[](https://codecov.io/github/r-lib/rcmdcheck?branch=master)
Run R CMD check form R programatically, and capture the results of the
individual checks.
## Installation
``` r
install.packages("rcmdcheck")
```
## Usage
``` r
library(rcmdcheck)
rcmdcheck("path/to/R/package")
```
Call `rcmdcheck()` on a source R package `.tar.gz` file, or on a folder
containing your R package. Supply `quiet = FALSE` if you want to omit
the output. The result of the check is returned, in a list with elements
`errors`, `warnings`, and `notes`. Each element is a character vector,
and one element of the character vectors is a single failure.
### Programmatic usage
`rcmdcheck()` returns an `rcmdcheck` object, which you can query and
manipulate.
``` r
library(rcmdcheck)
chk <- rcmdcheck("tests/testthat/bad1", quiet = TRUE)
chk
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────── badpackage 1.0.0 ────
#> Duration: 12.4s
#>
#> ❯ checking DESCRIPTION meta-information ... WARNING
#> Non-standard license specification:
#> Public domain
#> Standardizable: FALSE
#>
#> 0 errors ✔ | 1 warning ✖ | 0 notes ✔
```
`check_details()` turns the check results into a simple lists with the
following information currently:
``` r
names(check_details(chk))
#> [1] "package" "version" "notes" "warnings" "errors"
#> [6] "platform" "checkdir" "install_out" "description" "session_info"
#> [11] "cran" "bioc"
```
- `package`: Package name.
- `version`: Package version number.
- `notes`: Character vector of check `NOTE`s.
- `warnings`: Character vector of check `WARNING`s.
- `errors`: Character vector of check `ERROR`s.
- `platform`: Platform, e.g. `x86_64-apple-darwin15.6.0`.
- `checkdir`: Check directory.
- `install_out`: Output of the package installation.
- `description`: The text of the `DESCRIPTION` file.
- `session_info`: A `sessioninfo::session_info` object, session
information from within the check process.
- `cran`: Flag, whether this is a CRAN package. (Based on the
`Repository` field in `DESCRIPTION`, which is typically only set for
published CRAN packages.)
- `bioc`: Flag, whether this is a Bioconductor package, based on the
presence of the `biocViews` field in `DESCRIPTION`.
Note that if the check results were parsed from a file, some of these
fields might be missing (`NULL`), as we don’t have access to the
original `DESCRIPTION`, the installation output, etc.
### Parsing check output
`parse_check()` parses check output from a file, `parse_check_url()`
parses check output from a URL.
### CRAN checks
rcmdcheck has a functions to access CRAN’s package check results.
`cran_check_flavours()` downloads the names of the CRAN platforms:
``` r
cran_check_flavours()
#> [1] "r-devel-linux-x86_64-debian-clang" "r-devel-linux-x86_64-debian-gcc"
#> [3] "r-devel-linux-x86_64-fedora-clang" "r-devel-linux-x86_64-fedora-gcc"
#> [5] "r-devel-windows-x86_64" "r-patched-linux-x86_64"
#> [7] "r-patched-solaris-x86" "r-release-linux-x86_64"
#> [9] "r-release-macos-arm64" "r-release-macos-x86_64"
#> [11] "r-release-windows-ix86+x86_64" "r-oldrel-macos-x86_64"
#> [13] "r-oldrel-windows-ix86+x86_64"
```
`cran_check_results()` loads and parses all check results for a package.
``` r
cran_check_results("igraph")
#> $`r-devel-linux-x86_64-debian-clang`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking top-level files ... WARNING
#> Output from running autoreconf:
#> configure.ac:71: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:71: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:71: the top level
#> configure.ac:110: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:110: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:110: the top level
#> configure.ac:127: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:127: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:127: the top level
#>
#> 0 errors ✔ | 1 warning ✖ | 0 notes ✔
#>
#> $`r-devel-linux-x86_64-debian-gcc`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking top-level files ... WARNING
#> Output from running autoreconf:
#> configure.ac:71: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:71: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:71: the top level
#> configure.ac:110: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:110: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:110: the top level
#> configure.ac:127: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:127: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:127: the top level
#>
#> 0 errors ✔ | 1 warning ✖ | 0 notes ✔
#>
#> $`r-devel-linux-x86_64-fedora-clang`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 16.9Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 14.0Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-devel-linux-x86_64-fedora-gcc`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
#>
#> $`r-devel-windows-x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 9.8Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 6.9Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-devel-windows-x86_64-gcc10-UCRT`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking whether package 'igraph' can be installed ... ERROR
#> See below...
#>
#> ❯ checking package dependencies ... NOTE
#> Package suggested but not available for checking: 'rgl'
#>
#> ── Install failure ───────────────────────────────────────────────────────────────────────────────────────────────────────
#>
#> <00install.out file does not exist>
#> 1 error ✖ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-patched-linux-x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking top-level files ... WARNING
#> Output from running autoreconf:
#> configure.ac:71: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:71: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:71: the top level
#> configure.ac:110: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:110: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:110: the top level
#> configure.ac:127: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:127: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:127: the top level
#>
#> 0 errors ✔ | 1 warning ✖ | 0 notes ✔
#>
#> $`r-patched-solaris-x86`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 9.6Mb
#> sub-directories of 1Mb or more:
#> R 1.5Mb
#> help 1.2Mb
#> libs 6.5Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-release-linux-x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking top-level files ... WARNING
#> Output from running autoreconf:
#> configure.ac:71: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:71: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:71: the top level
#> configure.ac:110: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:110: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:110: the top level
#> configure.ac:127: warning: The macro `AC_HELP_STRING' is obsolete.
#> configure.ac:127: You should run autoupdate.
#> ./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
#> configure.ac:127: the top level
#>
#> 0 errors ✔ | 1 warning ✖ | 0 notes ✔
#>
#> $`r-release-macos-arm64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 23.7Mb
#> sub-directories of 1Mb or more:
#> R 2.0Mb
#> help 1.1Mb
#> libs 20.0Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-release-macos-x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 21.2Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 18.3Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-release-windows-ix86+x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 17.1Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 14.2Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-oldrel-macos-x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 21.2Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 18.3Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> $`r-oldrel-windows-ix86+x86_64`
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────────────── igraph 1.2.6 ────
#> Duration: 0ms
#>
#> ❯ checking installed package size ... NOTE
#> installed size is 17.1Mb
#> sub-directories of 1Mb or more:
#> R 1.4Mb
#> help 1.1Mb
#> libs 14.2Mb
#>
#> 0 errors ✔ | 0 warnings ✔ | 1 note ✖
#>
#> attr(,"package")
#> [1] "igraph"
#> attr(,"class")
#> [1] "rmcdcheck_cran_results"
```
### Comparing checks
`compare_checks()` can compare two or more `rcmdcheck` objects.
`compare_to_cran()` compares an `rcmdcheck` object to the CRAN checks of
the same package:
``` r
chk <- rcmdcheck(quiet = TRUE)
compare_to_cran(chk)
#> ── R CMD check comparison ────────────────────────────────────────────────────────────── rcmdcheck 1.3.3 / 1.3.3.9000 ────
#> Status: OK
#>
#> ── Fixed
#>
#> ✔ checking LazyData ... NOTE
#> ✔ checking LazyData ... NOTE
#> ✔ checking LazyData ... NOTE
#> ✔ checking LazyData ... NOTE
#> ✔ checking LazyData ... NOTE
#> ✔ checking LazyData ... NOTE
```
### Background processes
`rcmdcheck_process` is a `processx::process` class, that can run `R CMD
check` in the background. You can also use this to run multiple checks
concurrently. `processx::process` methods can be used to poll or
manipulate the check processes.
``` r
chkpx <- rcmdcheck_process$new()
chkpx
#> PROCESS 'R', running, pid 82576.
```
``` r
chkpx$wait()
chkpx$parse_results()
#> ── R CMD check results ───────────────────────────────────────────────────────────────────────── rcmdcheck 1.3.3.9000 ────
#> Duration: 23.6s
#>
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔
```
## License
MIT © Mango Solutions, Gábor Csárdi, RStudio
rcmdcheck/man/ 0000755 0001762 0000144 00000000000 14123052257 012751 5 ustar ligges users rcmdcheck/man/rcmdcheck-config.Rd 0000644 0001762 0000144 00000010760 14122343700 016425 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/options.R
\name{rcmdcheck-config}
\alias{rcmdcheck-config}
\title{rcmdcheck configuration}
\description{
Options take precedence over environment variables. E.g. if both
the \code{RCMDCHECK_NUM_COLORS} environment variables and the
\code{rcmdcheck.num_colors} option are set, then the latter is used.
}
\details{
rcmdcheck uses the cli package for much of its output, so you can
configure the output via cli, see \link[cli:cli-config]{cli::cli-config}.
Package configration is defined in the \code{DESCRIPTION} file of the checked
package. E.g.:\preformatted{Config/build/clean-inst-doc: FALSE
}
}
\section{Environment variables}{
\itemize{
\item \code{R_PROFILE_USER}: standard R environment variable to configure the
path to the user level R profile. See \link[base:Startup]{base::R_PROFILE_USER}.
\item \code{RCMDCHECK_BASE_URL}: URL to the root of the CRAN check web page.
You can use this to select an alternative CRAN mirror. Defaults to
\verb{https://cran.r-project.org/web/checks/}.
\item \code{RCMDCHECK_DETAILS_URL}: URL to the root of the CRAN check output
page. Defaults to \verb{https://www.r-project.org/nosvn/R.check/}.
\item \code{RCMDCHECK_ERROR_ON}: the default value for the \code{error_on} argument
of \code{\link[=rcmdcheck]{rcmdcheck()}}.
\item \code{RCMDCHECK_FLAVOURS_URL} URL to the CRAN check flavours page.
You can use this to select an alternative CRAN mirror. Defaults to
\verb{https://cran.r-project.org/web/checks/check_flavors.html}.
\item \code{RCMDCHECK_NUM_COLORS}: the number of ANSI colors to use in the output.
It can be used to override the number of colors detected or configured
by the cli package. See \code{\link[cli:num_ansi_colors]{cli::num_ansi_colors()}}. This configuration
is only used for the output of rcmdcheck and it does not affect the
examples and test cases (and other code) of the checked package.
It not set, then the default of cli is uesed. The corresponding
option is \code{rcmdcheck.num_colors}.
\item \code{RCMDCHECK_TIMESTAMP_LIMIT}: lower limit is seconds, above which
rcmdcheck adds time stamps to the individual check steps. It may be
fractional. Defaults to 1/3 of a second. The corresponding option is
\code{rcmdcheck.timestamp_limit}.
\item \code{RCMDCHECK_USE_RSTUDIO_PANDOC}: Flag (\code{true} or \code{false}). If \code{true},
then rcmdcheck \emph{always} puts RStudio's pandoc (if available) on the
path. If \code{false}, then it \emph{never} does that. If not set, or set to a
different value, then pandoc is put on the path only if it is not
already available. RStudio's pandoc is detected via an \code{RSTUDIO_PANDOC}
environment variable.
\item \code{RCMDCHECK_LOAD_CHECK_ENV}: you can use this environment variable
suppress loading environment variables from the \code{tools/check.env} file.
See \code{\link[=rcmdcheck]{rcmdcheck()}} for details.
\item \code{RSTUDIO_PANDOC}: if set, rcmdcheck adds this environment variable
to the PATH if pandoc is not on the PATH already. It is usually set
in RStudio. See also the \code{RCMDCHECK_USE_RSTUDIO_PANDOC} environment
variable.
}
}
\section{Options}{
\itemize{
\item \code{rcmdcheck.num_colors}: the number of ANSI colors to use in the output.
It can be used to override the number of colors detected or configured
by the cli package. See \code{\link[cli:num_ansi_colors]{cli::num_ansi_colors()}}. This configuration
is only used for the output of rcmdcheck and it does not affect the
examples and test cases (and other code) of the checked package.
It not set, then the default of cli is uesed. The corresponding
environment variable is \code{RCMDCHECK_NUM_COLORS}.
\item \code{rcmdcheck.test_output}: Flag (\code{TRUE} or \code{FALSE}), whether
\code{\link[=print.rcmdcheck]{print.rcmdcheck()}} should print the full test output if there are
no test failures. If some tests fail, then only the failures are
printed, independently of this option.
\item \code{rcmdcheck.timestamp_limit}: lower limit is seconds, above which
rcmdcheck adds time stamps to the individual check steps. It may be
fractional. Defaults to 1/3 of a second. The corresponding environment
variable is \code{RCMDCHECK_TIMESTAMP_LIMIT}.
}
}
\section{Package configuration:}{
\itemize{
\item \code{Config/build/clean-inst-doc}: Flag (\code{TRUE} or \code{FALSE}) to
specify if the \code{inst/doc} directory should be cleaned up when
building a package directory. If not specified, then \code{NULL} is used.
See the \code{clean_doc} option of \code{\link[pkgbuild:build]{pkgbuild::build()}} for more details.
}
}
rcmdcheck/man/print.rcmdcheck.Rd 0000644 0001762 0000144 00000001212 14120347676 016323 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.R
\name{print.rcmdcheck}
\alias{print.rcmdcheck}
\title{Print R CMD check results}
\usage{
\method{print}{rcmdcheck}(
x,
header = TRUE,
test_output = getOption("rcmdcheck.test_output", FALSE),
...
)
}
\arguments{
\item{x}{Check result object to print.}
\item{header}{Whether to print a header.}
\item{test_output}{if \code{TRUE}, include the test output in the results,
if there are no test failures. If some tests fail, then only the
failures are printed.}
\item{...}{Additional arguments, currently ignored.}
}
\description{
Print R CMD check results
}
rcmdcheck/man/compare_checks.Rd 0000644 0001762 0000144 00000001566 14120347676 016227 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{compare_checks}
\alias{compare_checks}
\title{Compare a set of check results to another check result}
\usage{
compare_checks(old, new)
}
\arguments{
\item{old}{A check result, or a list of check results.}
\item{new}{A check result.}
}
\value{
An \code{rcmdcheck_comparison} object with fields:
\itemize{
\item \code{package}: the name of the package, string,
\item \code{versions}: package versions, length two character,
\item \code{status}: comparison status, see below,
\item \code{old}: list of \code{rcmdcheck} objects the old check(s),
\item \code{new}: \code{rcmdcheck} object, the new check,
\item \code{cmp}:
}
}
\description{
Compare a set of check results to another check result
}
\seealso{
Other check comparisons:
\code{\link{compare_to_cran}()}
}
\concept{check comparisons}
rcmdcheck/man/print.rcmdcheck_comparison.Rd 0000644 0001762 0000144 00000001221 13146514764 020556 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/comparison.R
\name{print.rcmdcheck_comparison}
\alias{print.rcmdcheck_comparison}
\title{Print R CMD check result comparisons}
\usage{
\method{print}{rcmdcheck_comparison}(x, header = TRUE, ...)
}
\arguments{
\item{x}{R CMD check result comparison object.}
\item{header}{Whether to print the header. You can suppress the
header if you want to use the printout as part of another object's
printout.}
\item{...}{Additional arguments, currently ignored.}
}
\description{
See \code{\link[=compare_checks]{compare_checks()}} and \code{\link[=compare_to_cran]{compare_to_cran()}}.
}
rcmdcheck/man/parse_check.Rd 0000644 0001762 0000144 00000001413 14120347676 015517 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parse.R
\name{parse_check}
\alias{parse_check}
\title{Parse \code{R CMD check} results from a file or string}
\usage{
parse_check(file = NULL, text = NULL, ...)
}
\arguments{
\item{file}{The \code{00check.log} file, or a directory that
contains that file. It can also be a connection object.}
\item{text}{The contents of a \code{00check.log} file.}
\item{...}{Other arguments passed onto the constructor.
Used for testing.}
}
\value{
An \code{rcmdcheck} object, the check results.
}
\description{
At most one of \code{file} or \code{text} can be given.
If both are \code{NULL}, then the current working directory
is checked for a \code{00check.log} file.
}
\seealso{
\code{\link{parse_check_url}}
}
rcmdcheck/man/data_frame.Rd 0000644 0001762 0000144 00000001240 14120347676 015331 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{data_frame}
\alias{data_frame}
\title{Alternative to data.frame}
\usage{
data_frame(..., stringsAsFactors = FALSE)
}
\arguments{
\item{...}{Named data frame columns, or data frames.}
\item{stringsAsFactors}{Just leave it on \code{FALSE}. \verb{:)}}
}
\value{
Data frame.
}
\description{
\itemize{
\item Sets stringsAsFactors to FALSE by default
\item If any columns have zero length, the result will have
zero rows.
\item If a column is a scalar, then it will be recycled.
\item Non-matching number of rows gives an error, except for
lengths zero and one.
}
}
\keyword{internal}
rcmdcheck/man/parse_check_url.Rd 0000644 0001762 0000144 00000001071 14120347676 016401 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/parse.R
\name{parse_check_url}
\alias{parse_check_url}
\title{Shorthand to parse R CMD check results from a URL}
\usage{
parse_check_url(url, quiet = FALSE)
}
\arguments{
\item{url}{URL to parse the results from. Note that it should
not contain HTML markup, just the text output.}
\item{quiet}{Passed to \code{download.file}.}
}
\value{
An \code{rcmdcheck} object, the check results.
}
\description{
Shorthand to parse R CMD check results from a URL
}
\seealso{
\code{\link{parse_check}}
}
rcmdcheck/man/rcmdcheck.Rd 0000644 0001762 0000144 00000012436 14123052470 015166 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/package.R
\docType{package}
\name{rcmdcheck}
\alias{rcmdcheck}
\title{Run R CMD check from R and Capture Results}
\usage{
rcmdcheck(
path = ".",
quiet = FALSE,
args = character(),
build_args = character(),
check_dir = NULL,
libpath = .libPaths(),
repos = getOption("repos"),
timeout = Inf,
error_on = Sys.getenv("RCMDCHECK_ERROR_ON", c("never", "error", "warning",
"note")[1]),
env = character()
)
}
\arguments{
\item{path}{Path to a package tarball or a directory.}
\item{quiet}{Whether to print check output during checking.}
\item{args}{Character vector of arguments to pass to \verb{R CMD check}. Pass each
argument as a single element of this character vector (do not use spaces to
delimit arguments like you would in the shell). For example, to skip
running of examples and tests, use \code{args = c("--no-examples", "--no-tests")} and not \code{args = "--no-examples --no-tests"}. (Note that
instead of the \code{--output} option you should use the \code{check_dir} argument,
because \code{--output} cannot deal with spaces and other special characters on
Windows.)}
\item{build_args}{Character vector of arguments to pass to \verb{R CMD build}.
Pass each argument as a single element of this character vector (do not use
spaces to delimit arguments like you would in the shell). For example,
\code{build_args = c("--force", "--keep-empty-dirs")} is a correct usage and
\code{build_args = "--force --keep-empty-dirs"} is incorrect.}
\item{check_dir}{Path to a directory where the check is performed.
If this is not \code{NULL}, then the a temporary directory is used, that
is cleaned up when the returned object is garbage collected.}
\item{libpath}{The library path to set for the check.
The default uses the current library path.}
\item{repos}{The \code{repos} option to set for the check.
This is needed for cyclic dependency checks if you use the
\code{--as-cran} argument. The default uses the current value.}
\item{timeout}{Timeout for the check, in seconds, or as a
\link[base:difftime]{base::difftime} object. If it is not finished before this, it will be
killed. \code{Inf} means no timeout. If the check is timed out,
that is added as an extra error to the result object.}
\item{error_on}{Whether to throw an error on \verb{R CMD check} failures.
Note that the check is always completed (unless a timeout happens),
and the error is only thrown after completion. If \code{"never"}, then
no errors are thrown. If \code{"error"}, then only \code{ERROR} failures
generate errors. If \code{"warning"}, then \code{WARNING} failures generate
errors as well. If \code{"note"}, then any check failure generated an
error. Its default can be modified with the \code{RCMDCHECK_ERROR_ON}
environment variable. If that is not set, then \code{"never"} is used.}
\item{env}{A named character vector, extra environment variables to
set in the check process.}
}
\value{
An S3 object (list) with fields \code{errors},
\code{warnings} and \code{notes}. These are all character
vectors containing the output for the failed check.
}
\description{
Run R CMD check from R programmatically, and capture the results of the
individual checks.
Runs \verb{R CMD check} as an external command, and parses its output and
returns the check failures.
}
\details{
See \link{rcmdcheck_process} if you need to run \verb{R CMD check} in a background
process.
}
\section{Turning off package checks}{
Sometimes it is useful to programmatically turn off some checks that
may report check NOTEs.
rcmdcehck provides two ways to do this.
First, you may declare in \code{DESCRIPTION} that you don't want to see
NOTEs that are accepted on CRAN, with this entry:\preformatted{Config/rcmdcheck/ignore-inconsequential-notes: true
}
Currently, this will make rcmdcheck ignore the following notes:
\itemize{
\item report large package sizes (\verb{_R_CHECK_PKG_SIZES_ = FALSE}),
\item check cross-references in Rd files (\verb{_R_CHECK_RD_XREFS_ = FALSE}),
\item NOTE if package requires GNU make (\verb{_R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_ = FALSE}),
\item report marked non-ASCII strings in datasets (\verb{_R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_ = TRUE}).
}
The second way is more flexible, and lets you turn off individual checks
via setting environment variables.
You may provide a \code{tools/check.env} \emph{environment file} in your package
with the list of environment variable settings that rcmdcheck will
automatically use when checking the package.
See \link{Startup} for the format of this file.
Here is an example \code{tools/check.env} file:\preformatted{# Report if package size is larger than 10 megabytes
_R_CHECK_PKG_SIZES_THRESHOLD_=10
# Do not check Rd cross references
_R_CHECK_RD_XREFS_=false
# Do not report if package requires GNU make
_R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_=false
# Do not check non-ASCII strings in datasets
_R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_=true
}
See the \href{https://cran.r-project.org/doc/manuals/r-devel/R-ints.html}{"R internals" manual}
and the \href{https://github.com/wch/r-source}{R source code} for the
environment variables that control the checks.
Note that \code{Config/rcmdcheck/ignore-inconsequential-notes} and the
\code{check.env} file are only supported by rcmdcheck, and running
\verb{R CMD check} from a shell (or GUI) will not use them.
}
rcmdcheck/man/cran_check_results.Rd 0000644 0001762 0000144 00000001222 14120347676 017107 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cran.R
\name{cran_check_results}
\alias{cran_check_results}
\title{Download and parse R CMD check results from CRAN}
\usage{
cran_check_results(
package,
flavours = cran_check_flavours(package),
quiet = FALSE
)
}
\arguments{
\item{package}{Name of a single package to download the checks for.}
\item{flavours}{CRAN check flavours to use. Defaults to all
flavours that were used to check the package.}
\item{quiet}{Whether to omit the download progress bars.}
}
\value{
A list of \code{rcmdcheck} objects.
}
\description{
Download and parse R CMD check results from CRAN
}
rcmdcheck/man/check_details.Rd 0000644 0001762 0000144 00000002765 14120347676 016045 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api.R
\name{check_details}
\alias{check_details}
\title{Query R CMD check results and parameters}
\usage{
check_details(check)
}
\arguments{
\item{check}{A check result.}
}
\value{
A named list with elements:
\itemize{
\item \code{package}: package name.
\item \code{version}: package version.
\item \code{rversion}: R version.
\item \code{notes}: character vector of check NOTEs, each NOTE is an
element.
\item \code{warnings}: character vector of check WARNINGs, each WARNING is an
element.
\item \code{errors}: character vector of check ERRORs, each ERROR is an element.
A check timeout adds an ERROR to this vector.
\item \code{platform}: check platform
\item \code{checkdir}: check directory.
\item \code{install_out}: the output of the installation, contents of the
\verb{00install.out} file. A single string.
\item \code{description}: the contents of the DESCRIPTION file of the package.
A single string.
\item \code{session_info}: the output of \code{\link[sessioninfo:session_info]{sessioninfo::session_info()}},
from the R session performing the checks.
\item \code{checkdir}: the path to the check directory, if it hasn't been
cleaned up yet, or \code{NA}. The check directory is automatically
cleaned up, when the check object is deleted (garbage collected).
\item \code{cran}: whether it is a CRAN packaged package.
\item \code{bioc}: whether it is a BioConductor package.
}
}
\description{
Query R CMD check results and parameters
}
rcmdcheck/man/rcmdcheck_process.Rd 0000644 0001762 0000144 00000004524 14123052257 016726 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/background.R
\name{rcmdcheck_process}
\alias{rcmdcheck_process}
\title{Run an \verb{R CMD check} process in the background}
\description{
rcmdcheck_process is an R6 class, that extends the
\link[callr:rcmd_process]{callr::rcmd_process} class (which in turn extends \link[processx:process]{processx::process}.
}
\section{Usage}{
\preformatted{cp <- rcmdcheck_process$new(path = ".", args = character(),
build_args = character(), check_dir = NULL,
libpath = .libPaths(), repos = getOption("repos"))
cp$parse_results()
}
Other methods are inherited from \link[callr:rcmd_process]{callr::rcmd_process} and
\link[processx:process]{processx::process}.
Note that you calling the \code{get_output_connection} and
\code{get_error_connection} method on this is not a good idea, because
then the stdout and/or stderr of the process will not be collected
for \code{parse_results()}.
You can still use the \code{read_output_lines()} and \code{read_error_lines()}
methods to read the standard output and error, \code{parse_results()} is
not affected by that.
}
\section{Arguments}{
\itemize{
\item \code{cp}: A new rcmdcheck_process object.
\item \code{path}: Path to a package tree or a package archive file. This is the
package to check.
\item \code{args}: Command line arguments to \verb{R CMD check}.
\item \code{build_args}: Command line arguments to \verb{R CMD build}.
\item \code{check_dir}: Directory for the results.
\item \code{libpath}: The library path to set for the check.
\item \code{repos}: The \code{repos} option to set for the check.
This is needed for cyclic dependency checks if you use the
\code{--as-cran} argument. The default uses the current value.
\item \code{env}: A named character vector, extra environment variables to
set in the check process.
}
}
\section{Details}{
Most methods are inherited from \link[callr:rcmd_process]{callr::rcmd_process} and
\link[processx:process]{processx::process}.
\code{cp$parse_results()} parses the results, and returns an S3 object with
fields \code{errors}, \code{warnnigs} and \code{notes}, just like \code{\link[=rcmdcheck]{rcmdcheck()}}. It
is an error to call it before the process has finished. Use the
\code{wait()} method to wait for the check to finish, or the \code{is_alive()}
method to check if it is still running.
}
rcmdcheck/man/cran_check_flavours.Rd 0000644 0001762 0000144 00000001256 14120347676 017256 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cran.R
\name{cran_check_flavours}
\alias{cran_check_flavours}
\title{Download and show all CRAN check flavour platforms}
\usage{
cran_check_flavours(package = NULL)
}
\arguments{
\item{package}{CRAN package name or \code{NULL}.}
}
\value{
Character vector of platform ids.
}
\description{
If the \code{package} argument is \code{NULL}, then all current
platforms are downloaded. If the \code{package} argument is specified,
then all flavours used for the latest package checks for that
package, are downloaded and returned.
}
\examples{
\dontrun{
cran_check_flavours()
cran_check_flavours("simplegraph")
}
}
rcmdcheck/man/myrep.Rd 0000644 0001762 0000144 00000000572 13142421221 014367 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{myrep}
\alias{myrep}
\title{Recycle a vector or a data frame (rows)}
\usage{
myrep(x, len)
}
\arguments{
\item{x}{Vector or data frame to replicate. Must be length 0, 1, or
len.}
\item{len}{Expected length.}
}
\description{
Recycle a vector or a data frame (rows)
}
\keyword{internal}
rcmdcheck/man/compare_to_cran.Rd 0000644 0001762 0000144 00000001131 14120347676 016400 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{compare_to_cran}
\alias{compare_to_cran}
\title{Compare a check result to CRAN check results}
\usage{
compare_to_cran(check, flavours = cran_check_flavours(check$package))
}
\arguments{
\item{check}{A check result.}
\item{flavours}{CRAN check flavour(s) to use. By default all
platforms are used.}
}
\value{
An \code{rmdcheck_comparison} object.
}
\description{
Compare a check result to CRAN check results
}
\seealso{
Other check comparisons:
\code{\link{compare_checks}()}
}
\concept{check comparisons}
rcmdcheck/man/xopen.rcmdcheck.Rd 0000644 0001762 0000144 00000001230 13447166631 016321 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xopen.R
\name{xopen.rcmdcheck}
\alias{xopen.rcmdcheck}
\title{Open the check directory in a file browser window}
\usage{
\method{xopen}{rcmdcheck}(target, app = NULL, quiet = FALSE, ...)
}
\arguments{
\item{target}{\code{rcmdcheck()} result.}
\item{app}{Specify the app to open \code{target} with, and its arguments,
in a character vector. Note that app names are platform dependent.}
\item{quiet}{Whether to echo the command to the screen, before
running it.}
\item{...}{Additional arguments, not used currently.}
}
\description{
Open the check directory in a file browser window
}
rcmdcheck/DESCRIPTION 0000644 0001762 0000144 00000002202 14124357312 013701 0 ustar ligges users Package: rcmdcheck
Title: Run 'R CMD check' from 'R' and Capture Results
Version: 1.4.0
Authors@R:
person(given = "Gábor",
family = "Csárdi",
role = c("cre", "aut"),
email = "csardi.gabor@gmail.com")
Description: Run 'R CMD check' from 'R' and capture the results
of the individual checks. Supports running checks in the background,
timeouts, pretty printing and comparing check results.
License: MIT + file LICENSE
URL: https://r-lib.github.io/rcmdcheck/,
https://github.com/r-Lib/rcmdcheck#readme
BugReports: https://github.com/r-Lib/rcmdcheck/issues
Imports: callr (>= 3.1.1.9000), cli (>= 3.0.0), curl, desc (>= 1.2.0),
digest, pkgbuild, prettyunits, R6, rprojroot, sessioninfo (>=
1.1.1), utils, withr, xopen
Suggests: covr, knitr, mockery, processx, ps, rmarkdown, svglite,
testthat, webfakes
Encoding: UTF-8
RoxygenNote: 7.1.2
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2021-09-23 11:13:42 UTC; gaborcsardi
Author: Gábor Csárdi [cre, aut]
Maintainer: Gábor Csárdi
Repository: CRAN
Date/Publication: 2021-09-27 15:10:02 UTC
rcmdcheck/tests/ 0000755 0001762 0000144 00000000000 14122606412 013335 5 ustar ligges users rcmdcheck/tests/testthat/ 0000755 0001762 0000144 00000000000 14124357312 015201 5 ustar ligges users rcmdcheck/tests/testthat/REDCapR-fail.log 0000644 0001762 0000144 00000006403 13146514764 020011 0 ustar ligges users * using log directory ‘/Users/hadley/Documents/web/httr/revdep/checks/REDCapR/new/REDCapR.Rcheck’
* using R version 3.4.1 (2017-06-30)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘REDCapR/DESCRIPTION’ ... OK
* this is package ‘REDCapR’ version ‘0.9.8’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘REDCapR’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... ERROR
Running ‘test-all.R’
Running the tests in ‘tests/test-all.R’ failed.
Last 13 lines of output:
returned_object$success isn't true.
testthat results ================================================================
OK: 563 SKIPPED: 0 FAILED: 7
1. Failure: NameComesFromREDCap (@test-file-oneshot.R#15)
2. Error: NameComesFromREDCap (@test-file-oneshot.R#30)
3. Failure: Write Batch -Insert (@test-write-batch.R#16)
4. Failure: Write Batch -Insert (@test-write-batch.R#52)
5. Failure: Write Batch -Insert (@test-write-batch.R#54)
6. Failure: Write Batch -Insert (@test-write-batch.R#57)
7. Failure: Write Batch -Insert (@test-write-batch.R#58)
Error: testthat unit tests failed
Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ... NONE
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR
rcmdcheck/tests/testthat/minimal-ee.log 0000644 0001762 0000144 00000000557 14117731705 017734 0 ustar ligges users * using log directory ‘.’
* using R version 3.4.1 (2017-06-30)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* checking for file 'minimal/DESCRIPTION' ... OK
* this is package ‘minimal’ version ‘1.0.0’
* check 1 ... ERROR
Message 1
* check 2 ... OK
* check 3 ... OK
* check 4 ... ERROR
Message 4
* check 5 ... OK
rcmdcheck/tests/testthat/minimal-ok.log 0000644 0001762 0000144 00000000440 14117731705 017743 0 ustar ligges users * using log directory ‘.’
* using R version 3.4.1 (2017-06-30)
* this is package ‘minimal’ version ‘1.0.0’
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* check 1 ... OK
* check 2 ... OK
* check 3 ... OK
* check 4 ... OK
* check 5 ... OK
rcmdcheck/tests/testthat/test-comparison.R 0000644 0001762 0000144 00000001220 14120347676 020456 0 ustar ligges users
test_that("basic metadata stored in comparison object", {
cf <- compare_check_files(test_path("REDCapR-ok.log"), test_path("REDCapR-fail.log"))
expect_equal(cf$package, "REDCapR")
expect_equal(cf$versions, c("0.9.8", "0.9.8"))
})
test_that("status correctly computed when both checks are ok", {
cf <- compare_check_files(test_path("minimal-ok.log"), test_path("minimal-ok.log"))
expect_equal(cf$status, "+")
})
cli::test_that_cli("print message displays informative output", {
skip_on_cran()
cf <- compare_check_files(
test_path("minimal-ee.log"),
test_path("minimal-ewn.log")
)
expect_snapshot(
print(summary(cf))
)
})
rcmdcheck/tests/testthat/minimal-ewn.log 0000644 0001762 0000144 00000000577 14117731705 020136 0 ustar ligges users * using log directory ‘.’
* using R version 3.4.1 (2017-06-30)
* using platform: x86_64-apple-darwin15.6.0 (64-bit)
* using session charset: UTF-8
* checking for file 'minimal/DESCRIPTION' ... OK
* this is package ‘minimal’ version ‘1.0.0’
* check 1 ... ERROR
Message 1
* check 2 ... WARNING
Message 2
* check 3 ... NOTE
Message 3
* check 4 ... OK
* check 5 ... OK
rcmdcheck/tests/testthat/fixtures/ 0000755 0001762 0000144 00000000000 14122660375 017056 5 ustar ligges users rcmdcheck/tests/testthat/fixtures/win.rds 0000644 0001762 0000144 00000005331 14117731705 020367 0 ustar ligges users ZysI7BUPU<,3c>"6S&6'$㙖59c? LOwk4E~_qowoܻ7>ߏA%8%Xv@бFݹp|p:4mt-sF+uu2msmc&Ah:nlV&sLj~vP_v6sPHD93D#8
zQ$Zr)pId(BkdX
3`F.~PEnn0/+|MxLON@4X^d 8F
߰XKXzcG3@wYTO錽Ls?9(YXjhUNӒ*C~!C:E`` U0@@.0
VaނyrEŗ#mjm3;{!6*vJcxLcϤB1+Ub_z(H6cf7hv>)|'|xQ˪M,