initialize_project() takes max_loc_per_file. It stops with an error naming
every .R file that holds more code lines than the limit. The check runs before
the package check and before sourcing, so an oversized file stops the project
without installing or running anything first. The default is Inf, which
checks nothing. The argument otherwise takes one whole number of zero or more,
and rejects anything else.loc_per_file() is new and exported. It counts the code lines in each file you
give it. A code line is a physical line that is neither blank nor entirely a
comment.#, and it cannot
separate a comment that follows code from a comment that fills the line.
Measured across the 237 R files of the package fleet, the two approaches
disagree on 11 of them. The largest gap is 203 lines, in a file that embeds an
R template as a single string.path() passed its ... to paste0() as a single list. paste0() coerces a
list with as.character(), which deparses each element, so
path("home/", c("x", "y")) returned the one string home/c("x", "y").path() now recycles its components against each other, the way
file.path() does. path("home", c("a.csv", "b.csv")) returns two
paths. A component of length zero gives character(0), rather than a path
with an empty segment.initialize_project() built its list of source folders with one
path(home, folders_to_be_sourced) call, so it hit the defect above. Every
check reading that list saw nothing whenever folders_to_be_sourced held more
than one folder. That silently disabled check_missing_packages().source_to_environment() loops over the folders
and calls path() once per folder.max_loc_per_file = Inf. Such a project was never checked for
missing packages, and now it is. It can therefore stop, or install a package,
where earlier versions did neither.source_to_environment() selected files with the pattern "*.[rR]$". A
leading * has nothing to repeat, so the pattern matches any name ending in
r or R, not only an extension. helper, fooR and READMER all matched,
and initialize_project() sourced them."\\.[rR]$" in source_to_environment() and in the new
max_loc_per_file check, which have to agree about which files they cover.r or R inside a sourced folder. Such a file was sourced
before and is not sourced now.DESCRIPTION
carries Config/roxygen2/version in place of RoxygenNote.docs and data-raw are in .Rbuildignore. R CMD check reported both as
non-standard top-level files, and reported the generated font filenames under
docs/deps as non-portable paths.DESCRIPTION Authors@R now declares Richard Aubrey White as the
copyright holder, with role = "cph". It declared none at all, and
neither did any other package in the fleet. Nothing in R CMD check
reports that.CLAUDE.md now carries a Licensing section, so the year gets checked
rather than silently ageing.set_results() bug wrongly, on three
counts. is.na() on an environment returns logical(0), not FALSE. The
surrounding if then stopped on a zero-length condition, so the environment
never reached dir.exists(). The message was "argument is of length zero",
not "invalid filename argument". dir.exists() does give the latter when it
is called directly, which is where the string came from, but that path never
ran. The entry is corrected.set_results() given two paths where only the second exists returns
NULL and selects that one. It errors only when none of them exists. The
sentence is removed.ls_files() was titled "List files and directories recursively". It does not
recurse: it calls list.files() without recursive = TRUE. Given top.R and
sub/deep.R it returns sub and top.R, and never finds deep.R.R/, plus vignettes/org.Rmd, README.md and
index.md, now follows ASD-STE100 (Simplified Technical English). Every
sentence in those files runs to 25 words or fewer. The change splits long
sentences, prefers the active voice, and marks requirement levels with
RFC-2119 keywords. No behaviour changed.@param into @return and on into the next block's
title. The longest such reading was 65 words; its longest real component was
22. Adding the missing full stops fixed the grammar and the measurement.set_results(), which failed with "argument is of length zero" whenever
it was called after initialize_project(). initialize_project() stores the
sourcing environment in org::project$env. The folder-creation loop applied
is.na() to that environment. On an environment is.na() returns
logical(0), with a warning, rather than FALSE. The surrounding if then
received a zero-length condition and stopped. Non-character entries are now
skipped.project and set_results(), which previously had
none.\dontrun{} examples on initialize_project(),
move_directory(), and write_text() with examples that run against
tempdir().@family cross-links (project setup; file utilities) and a @seealso
pointing at vignette("org") to all seven exported objects.index.md, pkgdown/, and Rplots.pdf to .Rbuildignore.install_missing_packages argument to initialize_project(). Scans
folders_to_be_sourced for library(), require(), and pkg:: usage.
Errors on missing packages by default; set install_missing_packages = TRUE
to auto-install via pak (falls back to install.packages()).package_installed().create_project_quarto_internal_results() and
create_project_quarto_external_results().orgpackage_installed can now install packages if missing.create_project_quarto that provides an example project of how to use org with quarto.ls_files, move_file_or_dir, path.package_installed.env as an argument (the environment into which the functions will be sourced).Introduction of:
Depreciation of:
folders_to_be_sourced (previously this was hardcoded as a folder called code)AllowFileManipulationFromInitialiseProject and InitialiseProject