-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
145 lines (116 loc) · 4.95 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing-1)
![GitHub](https://img.shields.io/github/license/inbo/checklist)
[![License](https://img.shields.io/badge/license-GPL--3-blue.svg?style=flat)](https://www.gnu.org/licenses/gpl-3.0.html)
[![Release](https://img.shields.io/github/release/inbo/checklist.svg)](https://github.com/inbo/checklist/releases)
[![R build status](https://github.com/inbo/checklist/workflows/check%20package%20on%20main/badge.svg)](https://github.com/inbo/checklist/actions)
![r-universe name](https://inbo.r-universe.dev/badges/:name?color=c04384)
![r-universe package](https://inbo.r-universe.dev/badges/checklist)
[![Codecov test coverage](https://codecov.io/gh/inbo/checklist/branch/main/graph/badge.svg)](https://app.codecov.io/gh/inbo/checklist?branch=main)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/inbo/checklist.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/inbo/checklist.svg)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4028303.svg)](https://doi.org/10.5281/zenodo.4028303)
<!-- badges: end -->
# The Checklist Package <img src="man/figures/logo.svg" align="right" alt="A hexagon with the word checklist" width="120" />
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE, comment = "#>", fig.path = "man/figures/README-",
out.width = "100%", eval = FALSE
)
```
The goal of `checklist` is to provide an elaborate and strict set of checks for R packages and R code.
## Installation
You can install the package from the [INBO universe](https://inbo.r-universe.dev/builds) via
```{r universe}
# Enable the INBO universe
options(
repos = c(
inbo = "https://inbo.r-universe.dev", CRAN = "https://cloud.r-project.org"
)
)
# Install the packages
install.packages("checklist")
```
If that doesn't work, you can install the version from [GitHub](https://github.com/inbo/checklist/) with:
```{r installation}
# install.packages("remotes")
remotes::install_github("inbo/checklist")
```
## Setting a default organisation
We created `checklist` with the Research Institute for Nature and Forest (INBO) in mind.
When you don't specify the organisation, `checklist` assumes the code was written by INBO personnel.
INBO has specific requirements which are not relevant for external users of `checklist`.
When you are not writing code for INBO, we recommend that you set a default `organisation`.
Below we specify the defaults for INBO.
More details in `vignette("organisation", package = "checklist")`.
```{r organisation}
library(checklist)
org <- organisation$new(
github = "inbo", community = "inbo", email = "[email protected]",
rightsholder = "Research Institute for Nature and Forest (INBO)",
funder = "Research Institute for Nature and Forest (INBO)",
organisation = list(
"inbo.be" = list(
affiliation = c(
en = "Research Institute for Nature and Forest (INBO)",
nl = "Instituut voor Natuur en Bosonderzoek (INBO)"
),
orcid = TRUE
)
)
)
default_organisation(org = org)
```
## Using `checklist` on a package.
Before you can run the checks, you must initialise `checklist` on the package.
Either use `create_package()` to create a new package from scratch.
Or use `setup_package()` on an existing package.
More details in `vignette("getting_started", package = "checklist")`.
```{r package-initialise}
create_package()
```
Once initialised, you can run all the checks with `check_package()`.
Or run the individual checks.
```{r package-checks}
check_cran()
check_description()
check_documentation()
check_lintr()
check_filename()
check_folder()
update_citation()
```
To allow some of the warnings or notes, first run the checks and store them in an object.
Update `checklist.yml` by writing that object.
```{r package-allow-warnings}
x <- check_package()
write_checklist(x)
```
## Using `checklist` on a project.
Before you can run the checks, you must initialise `checklist` on the project.
Either use `create_project()` to create a new package from scratch.
Or use `setup_project()` on an existing package.
More details in `vignette("getting_started_project", package = "checklist")`.
```{r project-initialise}
library(checklist)
create_project()
```
Once initialised, you can run all the checks with `check_project()`.
Or run the individual checks.
```{r project-checks}
check_lintr()
check_filename()
check_folder()
update_citation()
```
To allow some of the warnings or notes, first run the checks and store them in an object.
Update `checklist.yml` by writing that object.
```{r project-allow-warnings}
x <- check_project()
write_checklist(x)
```