| Title: | A Thorough and Strict Set of Checks for R Packages and Source Code |
|---|---|
| Description: | An opinionated set of rules for R packages and R source code projects. |
| Authors: | Thierry Onkelinx [aut, cre] (ORCID: <https://orcid.org/0000-0001-8804-4216>, affiliation: Research Institute for Nature and Forest (INBO)), Els Lommelen [ctb] (ORCID: <https://orcid.org/0000-0002-3481-5684>, affiliation: Research Institute for Nature and Forest (INBO)), Hans Van Calster [ctb] (ORCID: <https://orcid.org/0000-0001-8595-8426>, affiliation: Research Institute for Nature and Forest (INBO)), Research Institute for Nature and Forest (INBO) [cph, fnd, pbl] (ROR: <https://ror.org/00j54wy13>) |
| Maintainer: | Thierry Onkelinx <[email protected]> |
| License: | GPL-3 |
| Version: | 0.6.0 |
| Built: | 2026-06-22 19:29:37 UTC |
| Source: | https://github.com/inbo/checklist |
Add AI agents
add_agents(x)add_agents(x)
x |
Either a |
Other both:
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
Add issue and pull request templates
add_issue_templates(x)add_issue_templates(x)
x |
Either a |
Other both:
add_agents(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
Ask for rights holder or funder
ask_rightsholder_funder(org, type = c("rightsholder", "funder", "publisher"))ask_rightsholder_funder(org, type = c("rightsholder", "funder", "publisher"))
org |
Organisation object |
type |
Character, either |
A list with the selected names and the updated organisation object
Other utils:
c_sort(),
create_hexsticker(),
execshell(),
install_pak(),
yesno()
Setting the locale before sorting ensures a stable sorting order
c_sort(x, ...)c_sort(x, ...)
x |
for |
... |
arguments to be passed to or from methods or (for the
default methods and objects without a class) to |
Other utils:
ask_rightsholder_funder(),
create_hexsticker(),
execshell(),
install_pak(),
yesno()
CRAN imposes an impressive list of tests on every package before publication.
This suite of test is available in every R installation.
Hence we use this full suite of tests too.
Notice that check_package() runs several additional tests.
check_cran(x = ".", quiet = FALSE, time_out = 30)check_cran(x = ".", quiet = FALSE, time_out = 30)
x |
Either a |
quiet |
Whether to print check output during checking. |
time_out |
The time in seconds to wait for a response from the world clock API. Default is 15 seconds, but you can increase this if you have a slow internet connection. If the world clock API is not available, the system clock will be used without a warning, but the check will be less reliable. |
A checklist object.
Other package:
check_description(),
check_documentation(),
check_environment(),
check_license(),
check_package(),
tidy_desc()
DESCRIPTION fileThe DESCRIPTION file contains the most important meta-data of the package.
A good DESCRIPTION is tidy, has a meaningful version number, full
author details and a clear license.
check_description(x = ".")check_description(x = ".")
x |
Either a |
This function ensures the DESCRIPTION is tidy, using tidy_desc().
The version number of the package must have either a 0.0 or a 0.0.0
format (see this discussion why
we allow only these formats).
The version number in every branch must be larger than the current version
number in the main or master branch.
New commits in the main or master must have a larger version number than the
previous commit.
We recommend to protect the main or master branch and to not commit into the
main or master.
Furthermore we check the author information.
Is INBO listed as copyright holder and funder?
Has every author an ORCID?
We check the license through check_license().
Other package:
check_cran(),
check_documentation(),
check_environment(),
check_license(),
check_package(),
tidy_desc()
The function make sure that the documentation is up to date. Rules:
You must use roxygen2 to document the
functions.
If you use a README.Rmd, it should be rendered.
You need at least a README.md.
Don't use a NEWS.Rmd but a NEWS.md.
NEWS.md must contain an entry for the current package version.
check_documentation(x = ".", quiet = FALSE)check_documentation(x = ".", quiet = FALSE)
x |
Either a |
quiet |
Whether to print check output during checking. |
The function generates the help files from the roxygen2 tag in the R code.
Then it checks whether any of the help files changed.
We use the same principle with the README.Rmd.
If any file changed, the documentation does not match the code.
Hence check_documentation() returns an error.
A side effect of running check_documentation() locally, is that it
generates all the documentation.
So the only thing left for you to do, is to commit these changes.
Pro tip: make sure RStudio renders the roxygen2 tags whenever you install
and restart the package.
We describe this in vignette("getting_started") under "Prepare local
setup".
NEWS.md
# package_name version * Description of something that changed. * Lines should not exceed 80 characters. Start a new line with two space to continue an item. * Add a single blank line before and after each header. ## Second level heading * You can use second level headings when you want to add more structure. # `package_name` version * Adding back ticks around the package name is allowed.
Other package:
check_cran(),
check_description(),
check_environment(),
check_license(),
check_package(),
tidy_desc()
Some actions will fail when these environment variables are not set. This function does only work on GitHub.
check_environment(x = ".")check_environment(x = ".")
x |
Either a |
An invisible checklist object.
Other package:
check_cran(),
check_description(),
check_documentation(),
check_license(),
check_package(),
tidy_desc()
A consistent naming schema avoids problems when working together,
especially when working with different OS.
Some OS (e.g. Windows) are case-insensitive whereas others (e.g. Linux) are
case-sensitive.
Note that the checklist GitHub Actions will test your code on Linux,
Windows and MacOS.
check_filename(x = ".")check_filename(x = ".")
x |
Either a |
The sections below describe the default rules.
We allow several exceptions when the community standard is different.
E.g. a package stores the function scripts in the R folder, while our
standard enforces lower case folder names.
Use the community standard, even if it does not conform with the checklist
rules.
Most likely checklist will have an exception for the name.
If not, you can file an issue and
motivate why you think we should add an exception.
Folder names should only contain lower case letters, numbers, dashes (-)
and underscores (_).
They can start with a single dot (.).
Base names should only contain lower case letters, numbers, dashes (-)
and underscores (_).
File extensions should only contain lower case letters and numbers.
Exceptions: file extensions related to R must have an upper case R (
.R, .Rd, .Rda, .Rnw, .Rmd, .Rproj).
Exception to these exceptions: R/sysdata.rda.
Underscores (_) causes problems for graphical files when using LaTeX to
create pdf output.
This is how we generate pdf output from rmarkdown.
Therefore you need to use a dash (-) as separator instead of
an underscores (_).
Applies to files with extensions csl, eps, gif, jpg, jpeg, pdf, png, ps, svg, tiff, tif, wmf and .cls.
We ignore files with .otf or .ttf extensions.
These are fonts files which often require their own file name scheme.
Other both:
add_agents(),
add_issue_templates(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
For the time being, this function only checks projects.
Keep in mind that R packages have requirements for the folder structure.
That is one of things that check_cran() checks.
check_folder(x = ".")check_folder(x = ".")
x |
Either a |
source: contains all R scripts and Rmd files.
data: contains all data files.
sourceA simple project with only R scripts or only Rmd files can place all the
files directly in the source folder.
More elaborate projects should place in the files in several folders under
source.
Place every bookdown document in a dedicated folder.
And create an RStudio project for that folder.
dataSimple projects in which source has no subfolders, place data at the
root of the project.
For more elaborate project you must choose between either data at the root
of the project or data as subfolder of the subfolders of source.
E.g. source/report/data.
Place the data in an open file format.
E.g. csv, txt or tsv for tabular data.
We strongly recommend to use git2rdata::write_vc() to store such data.
Use the geopackage format for spatial data.
Optionally add description of the data as markdown files.
Other project:
check_project(),
check_source()
Every package needs a clear license.
Without a license, the end-users have no clue under what conditions they can
use the package.
You must specify the license in the DESCRIPTION and provide a LICENSE.md
file.
check_license(x = ".", org)check_license(x = ".", org)
x |
Either a |
org |
An |
This functions checks if the DESCRIPTION mentions one of the standard
licenses.
The LICENSE.md must match this license.
Use setup_package() to add the correct LICENSE.md to the package.
Currently, following licenses are allowed:
GPL-3
MIT
We will consider pull requests adding support for other open source licenses.
Other package:
check_cran(),
check_description(),
check_documentation(),
check_environment(),
check_package(),
tidy_desc()
This functions does static code analysis.
It relies on lintr::lint_package().
We recommend that you activate all code diagnostics in RStudio to help
meeting the requirements.
You can find this in the menu Tools > Global options > Code >
Diagnostics.
Please have a look at vignette("philosophy") for more details on the rules.
check_lintr(x = ".", quiet = FALSE)check_lintr(x = ".", quiet = FALSE)
x |
Either a |
quiet |
Whether to print check output during checking. |
When check_lintr() runs on a git repository, it checks whether the
organisation has a custom .lintr file in their checklist repository.
If so, it uses this file.
Otherwise it looks for a local .lintr file in the project directory.
If this file is not present, it uses the default .lintr file provided
with the checklist package.
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
A convenience function that runs all packages related tests in sequence.
The details section lists the relevant functions.
After fixing a problem, you can quickly check if it is solved by running only
the related check.
But we still recommend to run check_package() before you push to GitHub.
And only push when the functions indicate that there are no problems.
This catches most problems before sending the code to GitHub.
check_package( x = ".", fail = !interactive(), pkgdown = interactive(), quiet = FALSE, time_out = 30 )check_package( x = ".", fail = !interactive(), pkgdown = interactive(), quiet = FALSE, time_out = 30 )
x |
Either a |
fail |
Should the function return an error in case of a problem?
Defaults to |
pkgdown |
Test pkgdown website.
Defaults to |
quiet |
Whether to print check output during checking. |
time_out |
The time in seconds to wait for a response from the world clock API. Default is 15 seconds, but you can increase this if you have a slow internet connection. If the world clock API is not available, the system clock will be used without a warning, but the check will be less reliable. |
List of checks in order:
check_cran()
check_lintr()
check_filename()
check_description()
check_documentation()
Other package:
check_cran(),
check_description(),
check_documentation(),
check_environment(),
check_license(),
tidy_desc()
Set or update the required checks via setup_project().
check_project(x = ".", fail = !interactive(), quiet = FALSE)check_project(x = ".", fail = !interactive(), quiet = FALSE)
x |
Either a |
fail |
Should the function return an error in case of a problem?
Defaults to |
quiet |
Whether to print check output during checking. |
Other project:
check_folder(),
check_source()
Defunct function.
Please use check_project() instead.
check_source(x = ".", fail = !interactive())check_source(x = ".", fail = !interactive())
x |
Either a |
fail |
Should the function return an error in case of a problem?
Defaults to |
Other project:
check_folder(),
check_project()
This function checks by default any markdown (.md) or Rmarkdown (.Rmd)
file found within the project.
It also checks any R help file (.Rd) in the man folder.
Use the set_exceptions() method of the checklist object to exclude files
or use a different language.
Have a look at vignette("spelling", package = "checklist") for more
details.
check_spelling(x = ".", quiet = FALSE)check_spelling(x = ".", quiet = FALSE)
x |
Either a |
quiet |
Whether to print check output during checking. |
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
A class which contains all checklist results.
spelling -> checklist
packageA logical indicating whether the source code refers to a package.
get_checkedA vector with checked topics.
get_gha_installA vector with bash commands for GitHub Actions.
get_pathThe path to the package.
get_pakPackages to install with pak::pkg_install().
get_requiredA vector with the names of the required checks.
get_spellingReturn the issues found by check_spelling()
failA logical indicating if any required check fails.
templateA list for a check list template.
checklist$add_error()Add errors
checklist$add_error(errors, item, keep = TRUE)
errorsA vector with errors.
itemThe item on which to store the errors.
keepKeep old results
checklist$add_linter()Add results from lintr::lint_package()
checklist$add_linter(linter, error = FALSE)
linterA vector with linter errors.
errorA logical indicating if the linter should be considered an error.
checklist$add_motivation()Add motivation for allowed issues.
checklist$add_motivation(which = c("warnings", "notes"))
whichWhich kind of issue to add.
checklist$add_notes()Add notes
checklist$add_notes(notes, item)
notesA vector with notes.
itemThe item on which to store the notes.
checklist$add_rcmdcheck()Add results from rcmdcheck::rcmdcheck
checklist$add_rcmdcheck(errors, warnings, notes)
errorsA vector with errors.
warningsA vector with warning messages.
notesA vector with notes.
checklist$add_spelling()Add results from check_spelling()
checklist$add_spelling(issues)
issuesA data.frame with spell checking issues.
checklist$add_warnings()Add warnings
checklist$add_warnings(warnings, item)
warningsA vector with warnings.
itemThe item on which to store the warnings.
checklist$allowed()Add allowed warnings and notes
checklist$allowed( warnings = vector(mode = "list", length = 0), notes = vector(mode = "list", length = 0) )
warningsA vector with allowed warning messages. Defaults to an empty list.
notesA vector with allowed notes. Defaults to an empty list.
packageDoes the check list refers to a package.
Defaults to TRUE.
checklist$confirm_motivation()Confirm the current motivation for allowed issues.
checklist$confirm_motivation(which = c("warnings", "notes"))
whichWhich kind of issue to confirm.
checklist$new()Initialize a new checklist object.
checklist$new(x = ".", language, package = TRUE)
xThe path to the root of the project.
languageThe default language for spell checking.
packageIs this a package or a project?
checklist$print()Print the checklist object.
Add quiet = TRUE to suppress printing.
checklist$print(...)
...See description.
checklist$set_pak()Set packages to install with pak::pkg_install().
checklist$set_pak(pkg = character(0))
pkgA vector of packages to install with pak::pkg_install().
checklist$set_gha_install()Set optional install commands for GitHub Actions
checklist$set_gha_install(commands)
commandsA vector with commands.
checklist$set_required()set required checks
checklist$set_required(checks = character(0))
checksa vector of required checks
checklist$clone()The objects of this class are cloneable with this method.
checklist$clone(deep = FALSE)
deepWhether to make a deep clone.
Other class:
spelling
update local branches that are behind their counterpart on origin.
list local branches that have diverged from their counterpart the origin.
list local branches without counterpart on origin that have diverged from the main branch.
remove local branches without counterpart on origin and fully merged into the main branch.
remove local copies of origin branches deleted at the origin.
clean_git(repo = ".", verbose = TRUE)clean_git(repo = ".", verbose = TRUE)
repo |
The path to the git repository. If the directory is not a
repository, parent directories are considered (see git_find). To disable
this search, provide the filepath protected with |
verbose |
display some progress info while downloading |
Other git:
is_repository(),
is_workdir_clean(),
new_branch(),
set_tag()
This function makes a hexagonal logo in INBO style for the provided package name.
create_hexsticker( package_name, filename = file.path("man", "figures", "logo.svg"), icon, x = 0, y = 0, scale = 1 )create_hexsticker( package_name, filename = file.path("man", "figures", "logo.svg"), icon, x = 0, y = 0, scale = 1 )
package_name |
package name that should be mentioned on the hexagonal sticker. |
filename |
filename to save the sticker. |
icon |
optional filename to an |
x |
number of pixels to move the icon to the right. Use negative numbers to move the icon to the left. |
y |
number of pixels to move the icon to the bottom. Use negative numbers to move the icon to the top. |
scale |
Scales the |
A figure is saved in the working directory or provided path.
Other utils:
ask_rightsholder_funder(),
c_sort(),
execshell(),
install_pak(),
yesno()
## Not run: # make tempfile to save logo (or just use (path and) filename) #' output <- tempfile(pattern = "hexsticker", fileext = ".svg") create_hexsticker("checklist", filename = output) ## End(Not run)## Not run: # make tempfile to save logo (or just use (path and) filename) #' output <- tempfile(pattern = "hexsticker", fileext = ".svg") create_hexsticker("checklist", filename = output) ## End(Not run)
Creates a package template in a new folder.
Use this function when you want to start a new package.
Please DO READ vignette("getting_started") before running this function.
create_package(package, path = ".")create_package(package, path = ".")
package |
Name of the new package. |
path |
Where to create the package directory. |
What you get with a checklist setup:
minimal folder structure and files required for an R package using INBO guidelines with GPL-3 or MIT license.
an RStudio project file
a local git repository
an initial NEWS.md file
a template for an README.Rmd
set-up for automated checks and releases of the package using GitHub Actions.
a code of conduct and contributing guidelines.
the set-up for a pkgdown website using the INBO corporate identity.
Other setup:
create_project(),
prepare_ghpages(),
set_license(),
setup_package(),
setup_project(),
setup_source()
This function creates a new RStudio project with checklist functionality.
create_project(path, project)create_project(path, project)
path |
The folder in which to create the project as a folder. |
project |
The name of the project. |
Other setup:
create_package(),
prepare_ghpages(),
set_license(),
setup_package(),
setup_project(),
setup_source()
Add words to custom dictionaries
custom_dictionary(issues)custom_dictionary(issues)
issues |
The output of |
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
print.checklist_spelling(),
read_checklist(),
update_citation(),
write_checklist()
Cross-platform function to pass a command to the shell, using either
base::system() or (Windows-only) base::shell(), depending on the
operating system.
execshell(commandstring, intern = FALSE, path = ".", ...)execshell(commandstring, intern = FALSE, path = ".", ...)
commandstring |
The system command to be invoked, as a string. Multiple commands can be combined in this single string, e.g. with a multiline string. |
intern |
a logical (not |
path |
The path from where the command string needs to be executed |
... |
Other arguments passed to |
Other utils:
ask_rightsholder_funder(),
c_sort(),
create_hexsticker(),
install_pak(),
yesno()
checklist.yml
Install extra packages defined in checklist.yml
install_pak(x = ".", ...)install_pak(x = ".", ...)
x |
Either a |
... |
Additional arguments passed to |
Other utils:
ask_rightsholder_funder(),
c_sort(),
create_hexsticker(),
execshell(),
yesno()
The path arguments specifies the directory at which to start the search for a git repository. If it is not a git repository itself, then its parent directory is consulted, then the parent's parent, and so on.
is_repository(path = ".")is_repository(path = ".")
path |
the location of the git repository, see details. |
TRUE if directory is in a git repository else FALSE
Other git:
clean_git(),
is_workdir_clean(),
new_branch(),
set_tag()
A clean working directory has no staged, unstaged or untracked files.
is_workdir_clean(repo)is_workdir_clean(repo)
repo |
The path to the git repository. If the directory is not a
repository, parent directories are considered (see git_find). To disable
this search, provide the filepath protected with |
TRUE when there are no staged, unstaged or untracked files.
Otherwise FALSE
Other git:
clean_git(),
is_repository(),
new_branch(),
set_tag()
This functions first runs clean_git().
Then it creates the new branch from the (updated) main branch.
new_branch(branch, verbose = TRUE, checkout = TRUE, repo = ".")new_branch(branch, verbose = TRUE, checkout = TRUE, repo = ".")
branch |
name of branch to check out |
verbose |
display some progress info while downloading |
checkout |
move HEAD to the newly created branch |
repo |
The path to the git repository. If the directory is not a
repository, parent directories are considered (see git_find). To disable
this search, provide the filepath protected with |
Other git:
clean_git(),
is_repository(),
is_workdir_clean(),
set_tag()
gh-pages branch with a place holder pagePrepare a gh-pages branch with a place holder page
prepare_ghpages(x = ".", verbose = TRUE)prepare_ghpages(x = ".", verbose = TRUE)
x |
Either a |
verbose |
display some progress info while downloading |
Other setup:
create_package(),
create_project(),
set_license(),
setup_package(),
setup_project(),
setup_source()
checklist_spelling summaryDisplay a checklist_spelling summary
## S3 method for class 'checklist_spelling' print(x, ...)## S3 method for class 'checklist_spelling' print(x, ...)
x |
The |
... |
currently ignored |
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
read_checklist(),
update_citation(),
write_checklist()
The checklist package stores configuration information in the checklist.yml
file in the root of a project.
This function reads this configuration.
It is mainly used by the other functions inside the package.
If no checklist.yml file is found at the path,
the function walks upwards through the directory structure until it finds
such file.
The function returns an error when it reaches the root of the disk without
finding a checklist.yml file.
read_checklist(x = ".")read_checklist(x = ".")
x |
Either a |
A checklist object.
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
update_citation(),
write_checklist()
Set the proper license
set_license(x = ".", license, org)set_license(x = ".", license, org)
x |
Either a |
license |
the license to set. If missing, the user will be prompted to choose a license. |
org |
An |
Invisible NULL.
Other setup:
create_package(),
create_project(),
prepare_ghpages(),
setup_package(),
setup_project(),
setup_source()
This function is a part of the GitHub Action.
Therefore it only works when run in a GitHub Action on the main or master
branch.
Otherwise it will only return a message.
It sets a new tag at the current commit using the related entry from
NEWS.md as message.
This tag will turn into a release.
set_tag(x = ".")set_tag(x = ".")
x |
Either a |
Other git:
clean_git(),
is_repository(),
is_workdir_clean(),
new_branch()
Use this function when you have an existing package and you want to use the
checklist functionality.
Please keep in mind that the checklist is an opinionated list of checks.
It might require some breaking changes in your package.
Please DO READ vignette("getting_started") before running this function.
setup_package(path = ".")setup_package(path = ".")
path |
The path to the package.
Defaults to |
What you get with a checklist setup:
minimal folder structure and files required for an R package using INBO guidelines with GPL-3 or MIT license.
an RStudio project file
a local git repository
an initial NEWS.md file
a template for an README.Rmd
set-up for automated checks and releases of the package using GitHub Actions.
a code of conduct and contributing guidelines.
the set-up for a pkgdown website using the INBO corporate identity.
Other setup:
create_package(),
create_project(),
prepare_ghpages(),
set_license(),
setup_project(),
setup_source()
checklist on an existing R projectUse this function to set-up or change the checklist infrastructure for an
existing project.
The function interactively asks questions to set-up the required checks.
setup_project(path = ".")setup_project(path = ".")
path |
the project root folder |
Other setup:
create_package(),
create_project(),
prepare_ghpages(),
set_license(),
setup_package(),
setup_source()
This adds the required GitHub workflows to run check_source() automatically
whenever you push commits to GitHub.
It also adds a
CC-BY 4.0 license file,
a
CODE_OF_CONDUCT.md
and the checklist configuration file (checklist.yml).
setup_source(path = ".")setup_source(path = ".")
path |
The path to the project.
Defaults to |
Other setup:
create_package(),
create_project(),
prepare_ghpages(),
set_license(),
setup_package(),
setup_project()
A class with the configuration for spell checking
defaultThe default language of the project.
get_mdThe markdown files within the project.
get_rThe R files within the project.
get_rdThe Rd files within the project.
settingsA list with current spell checking settings.
spelling$new()Initialize a new spelling object.
spelling$new(language, base_path = ".")
languagethe default language.
base_paththe base path of the project
spelling$print()Print the spelling object.
spelling$print(...)
...currently ignored.
spelling$set_default()Define which files to ignore or to spell check in a different language.
spelling$set_default(language)
languageThe language.
spelling$set_exceptions()Define which files to ignore or to spell check in a different language.
spelling$set_exceptions()
spelling$set_ignore()Manually set the ignore vector. Only use this if you known what you are doing.
spelling$set_ignore(ignore)
ignoreThe character vector with ignore file patterns.
spelling$set_other()Manually set the other list. Only use this if you known what you are doing.
spelling$set_other(other)
othera list with file patterns per additional language.
spelling$clone()The objects of this class are cloneable with this method.
spelling$clone(deep = FALSE)
deepWhether to make a deep clone.
Other class:
checklist
A tidy DESCRIPTION uses a strict formatting and order of key-value pairs.
This function reads the current DESCRIPTION and overwrites it with a tidy
version.
tidy_desc(x = ".")tidy_desc(x = ".")
x |
Either a |
Other package:
check_cran(),
check_description(),
check_documentation(),
check_environment(),
check_license(),
check_package()
The function extracts citation meta data from the project. Then it checks the required meta data. Upon success, it writes several files.
update_citation(x = ".", quiet = FALSE)update_citation(x = ".", quiet = FALSE)
x |
Either a |
quiet |
Whether to print check output during checking. |
.zenodo.json contains the citation information in the format that
Zenodo requires.
CITATION.cff provides the citation information in the format that
GitHub requires.
inst/CITATION provides the citation information in the format that
R packages require.
It is only relevant for packages.
An invisible checklist object.
Source of the citation meta data:
package: DESCRIPTION
project: README.md
Should you want to add more information to the inst/CITATION file,
add it to that file outside # begin checklist entry and
# end checklist entry.
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
write_checklist()
checklist stores it configuration as a checklist.yml file.
create_package(), setup_package() and setup_source() generate a default
file.
If you need to allow some warnings or notes, you need to update the
configuration.
write_checklist(x = ".")write_checklist(x = ".")
x |
Either a |
First run x <- checklist::check_package() or
x <- checklist::check_source().
These commands run the checks and store the checklist object in the
variable x.
Next you can store the configuration with checklist::write_checklist(x).
This will first list any existing allowed warnings or notes.
For every one of them, choose whether you want to keep it or not.
Next, the function presents every new warning or note which you may allow or
not.
If you choose to allow a warning or note, you must provide a motivation.
Please provide a sensible motivation.
Keep in mind that checklist.yml stores these motivations in plain text,
so they are visible for other users.
We use the yesno() function to make sure you carefully read the questions.
When you allow a warning or note, this warning or note must appear.
Otherwise you get a "missing warning" or "missing note" error.
So if you fix an allowed warning or note, you need to rerun
checklist::write_checklist(x) and remove the old version.
If you can solve a warning or note, then solve it rather than to allow it.
Only allow a warning or note in case of a generic "problem" that you can't
solve.
The best example is the checking CRAN incoming feasibility ... NOTE New submission which appears when checking a package not on
CRAN.
That is should an allowed note as long as the package is not on CRAN.
Or permanently when your package is not intended for CRAN.
Do not allow a warning or note to fix an issue specific to your machine. That will result in an error when checking the package on an other machine (e.g. GitHub actions).
Other both:
add_agents(),
add_issue_templates(),
check_filename(),
check_lintr(),
check_spelling(),
custom_dictionary(),
print.checklist_spelling(),
read_checklist(),
update_citation()
A function that asks a yes or no question to the user
yesno(...)yesno(...)
... |
Currently ignored |
A logical where TRUE implies a "yes" answer from the user.
Hadley Wickham [email protected]
Largely based on devtools:::yesno().
The user gets three options in an random order: 2 for "no", 1 for "yes".
The wording for "yes" and "no" is random as well.
This forces the user to carefully read the question.
Other utils:
ask_rightsholder_funder(),
c_sort(),
create_hexsticker(),
execshell(),
install_pak()