check_folder() prints the lines of folder_report(). In a session that
is not interactive, it quits R with status 1 after a FAIL, so a script
that calls it fails. A WARN or a SKIP does not quit R.
Usage
check_folder(
path = ".",
config = "checkit.yml",
rules = general_rules(),
sets = system.file("rules", package = "checkit"),
scope = default_scope,
messages = checkit_messages(),
set_pattern = "^checkit_([0-9]{4})_([0-9]{2})_([0-9]{2})$",
reserved_ignore = function(set) character(0),
reserved_rules = character(0)
)Arguments
- path
The project folder.
- config
The name of the config file in
path. A rule set MAY hold the keypackages, a map from the name of a package to its minimum version. It is not a rule. The runner gives it to each rule function that has the argumentpackages, such as the function ofrule_set_pinned.- rules
The registry: a named list of
rule()entries, such ascompose_rules()gives. The default isgeneral_rules().- sets
The folder of the rule sets. The default is the folder
rulesof checkit.- scope
A function
scope(path, ignore)that returns the named listfilesthat each rule function gets.ignoreholds the folders of the keyignorefor a rule that is not locked, and is empty for a locked rule. The default isdefault_scope().- messages
The texts of the config messages, a named list as
checkit_messages()gives.- set_pattern
A regular expression that each name of a rule set matches. Its three groups are the year, the month and the day of the set.
- reserved_ignore
A function of the name of the set of the project that returns regular expressions. An entry of
ignorethat one of them matches is an error.- reserved_rules
A named character vector. Each name is a name that the keys
rulesandallowMUST NOT hold. The error is"<config>: <key>: <name> <value>", so each value is the rest of the message.
Value
Invisibly, the findings of folder_findings().
See also
Other runner:
checkit_messages(),
compose_rules(),
default_scope(),
folder_findings(),
folder_report(),
general_rules(),
rule(),
rules()