default_scope() gives the files that each rule of general_rules()
reads in the project folder path. It is the default scope of
folder_findings().
Usage
default_scope(path, ignore = character(0))Value
A named list with the elements entries, code, scripts,
scripts_sorted, exempt_paths, changelog_code and frozen.
Details
The list has these elements:
entries: each file and folder of the project, as paths relative topath. In the top folder of a git repository, these are the files that git tracks or does not ignore, and their folders. Otherwise they are the files and folders on disk. The files and folders of an OS or an editor, such as.DS_Storeand.git, are left out.code,scriptsandscripts_sorted: the.Rfiles ofentriesunder the folderR/.scripts_sortedhas them in the C locale order.exempt_paths: the paths ofentriesthatlower_case_namespasses. These are the files and folders namedREADME.md,CHANGELOG.md,NEWS.md,AGENTS.md,CLAUDE.md,LICENSE,DESCRIPTIONorNAMESPACEat any depth. So an R package passes on its standard files. The folderRat the top level holds the code, and it is exempt too. So is each file at the top level whose name starts with a dot or ends with.Rproj.changelog_code:"^R/", so a change underR/needs a change toCHANGELOG.md.frozen: one element for each file ofentrieswhose name ends with.frozen.md5. Itscoversare the files on disk now in the folder of the manifest, at any depth and hidden files included. A file whose name ends with.frozen.md5is not incovers. A file under a folder.gitis not incoverseither, because git changes these files. Itsmissing_detailisNULL, so no manifest is required.
Each path in a manifest is relative to path. So write a manifest with
freeze(home = path), and put it in the folder that it freezes.
See also
Other runner:
check_folder(),
checkit_messages(),
compose_rules(),
folder_findings(),
folder_report(),
general_rules(),
rule(),
rules()
Examples
home <- file.path(tempdir(), "checkit_scope_example")
dir.create(file.path(home, "R"), recursive = TRUE)
dir.create(file.path(home, "data"))
writeLines("x <- 1", file.path(home, "R", "f.R"))
writeLines("a,b", file.path(home, "data", "raw.csv"))
checkit::freeze("data", "data/data.frozen.md5", home = home)
scope <- checkit::default_scope(home)
scope$code
#> [1] "R/f.R"
scope$frozen[[1]]$covers
#> [1] "data/raw.csv"
unlink(home, recursive = TRUE)