-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
executable file
·78 lines (51 loc) · 2.38 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit only README.Rmd! -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
message = FALSE
)
```
<!-- badges: start -->
[![R build status](https://github.com/mikldk/roxytest/workflows/R-CMD-check/badge.svg)](https://github.com/mikldk/roxytest/actions)
<!-- badges: end -->
# roxytest
Inline tests with [`roxygen2`](https://cran.r-project.org/package=roxygen2) using [`testthat`](https://cran.r-project.org/package=testthat) or [`tinytest`](https://cran.r-project.org/package=tinytest).
In addition, there are a few roclets that aim at catching common documentation issues
during the development cycle.
See demo package using this at
[`roxytestdemo`](https://github.com/mikldk/roxytestdemo).
## Install
To build and install from Github run this command from within `R`:
```
remotes::install_github("mikldk/roxytest",
build_opts = c("--no-resave-data", "--no-manual"))
```
You can also install the package without vignettes if needed as follows:
```
remotes::install_github("mikldk/roxytest")
```
## Documentation
Please refer to this `README` as well as the included manual pages as well as the vignette,
all also available online at <https://mikldk.github.io/roxytest/>.
## Usage
There are a number of roclets included:
* `testthat_roclet`
* `tinytest_roclet`
* `param_roclet`
* `return_roclet`
* `examples_roclet`
Please refer to the "[Introduction](https://mikldk.github.io/roxytest/articles/introduction.html)" vignette for details on these.
To use the package in your own package you do not need to add any additional
dependencies in your package's `DESCRIPTION` file.
Simply add the following lines to your package's `DESCRIPTION` file (or any other of the roclets mentioned above):
```
Roxygen: list(roclets = c("namespace", "rd", "roxytest::testthat_roclet"))
```
## Notes
### Document package keyboard shortcut
In RStudio, `CTRL+SHIFT+D`/`CMD+SHIFT+D` option does not run `devtools::document()` but only `devtools::document(roclets=c('rd', 'collate', 'namespace'))` (possibly with fewer depending on the project options, but not none).
Instead, you can use `devtools`' `document()` [addin](https://github.com/r-lib/devtools/pull/2188) (see e.g. [Rstudio documentation](https://rstudio.github.io/rstudioaddins/)), and override the keyboard shortcut.