Releases: ThinkR-open/attachment
attachment 1.0.0 - AST-based detection (CRAN release)
On CRAN since 2026-04-25. See the package page.
Detection - new foundation
att_from_rscript()now walks the R syntax tree instead of matching the source text with regexes. Dependency detection no longer produces false positives on::inside string literals or comments (e.g. xpathfollowing-sibling::td, CSSlabel::after,sprintf('%s::plot()', ...)) (#120, #132).- The AST walker safely handles "empty" call arguments (
x[, 1],x[1, ], emptyswitchalternatives, missingelsebranches). Earlier development drafts of the walker crashed withargument "el" is missing, with no defaulton any script containing these patterns, which would have silently degraded every real-world script to the legacy regex fallback.
Detection - new patterns recognised
att_from_rscript()also recognisesuse("pkg", ...)(R >= 4.4) (#128),getFromNamespace("fn", "pkg"),loadNamespace(), and named-argument forms such aslibrary(package = "pkg")orrequireNamespace("pkg", lib.loc = "...").- Fully-qualified dependency-introducing calls such as
base::library(pkg),base::requireNamespace("pkg"), andmethods::getFromNamespace(fn, "pkg")are now honoured; the inner package is added to the dependency list. - Introspection helpers (
packageVersion(),getNamespace(),asNamespace(),attachNamespace()) are intentionally not treated as dependency introducers to avoid silently wideningImportson code that only uses them for feature detection.
Detection - robustness
att_from_rscript()gains anencodingargument (defaultgetOption("encoding")) so scripts saved in Latin-1 / Windows-1252 are read with the system locale instead of being forced to UTF-8.att_from_rscript()now warns when a file fails to parse as valid R code and the legacy regex-based detector is used as a fallback, so broken scripts are no longer silently degraded.- The legacy regex-based fallback detector now accepts underscores in package names (e.g.
my_pkg::fn). Previously an underscore truncated the detected name to the portion after the underscore, so a single syntax error upstream could corrupt detection across the whole file.
Vignettes & Rmd / Quarto
att_from_rmds()infers the vignette engine from the files actually present:quartois added when.qmdfiles are found,rmarkdownwhen.Rmdfiles are found, both when the directory mixes the two. Previouslyrmarkdownwas forced in for.qmd-only projects (#131).att_from_rmd()/att_from_rmds():inside_rmdnow defaults toNULLand is auto-detected viaknitr::opts_knit$get("out.format"), so users no longer have to think about it (#106).
Maintenance
- Dropped the
{fusen}development workflow;R/amend_with_config.R,R/create_dependencies_file.R,R/dependencies_file_text.Rand their tests are now hand-maintained. - Fixed
create_renv_for_dev()by removing'renv'fromfolder_to_include. - Added a manual detection edge-case harness at
dev/manual_detection_edge_cases.Rcovering ~170 scripted cases (true positives, false positives, known limitations) to make future regressions of the detector obvious.
attachment 0.4.5 - escape characters fix in roxygen examples
On CRAN since 2025-03-14. See the package page.
Bug fixes
att_from_examples()removed escape characters (\) from Roxygen examples.
attachment 0.4.3 - att_from_examples + att_from_data
On CRAN since 2025-01-31. See the package page.
New features
- Add
att_from_examples()to get all packages called in examples from R files - Add
att_from_data()to look for functions called in data loading code att_amend_descamend package DESCRIPTION file (Suggests) with the list of dependencies extracted from examples in R files.set_remotes_to_desc()takes into account the branch
Patch
- Adding an example using suggest packages to the dummypackage
att_from_rmds()andatt_from_rscriptdoesn't search in 'renv' folder anymore
v0.4.4
fix rd (#126) Co-authored-by: Your Name <you@example.com>
attachment 0.4.2
attachment 0.4.2
create_renv_for_devcan work even outside of an R packages
attachment 0.4.1
attachment 0.4.1
Bug fixes
- Modification of unit tests following {roxygen2} changes.
att_amend_descandatt_from_namespacereturn messages instead of warnings. (#107)
v0.4.0 - Breaking changes and configuration file for a better experience
attachment 0.4.0
Breaking changes
-
When using
att_amend_desc()without the default parameters, likepkg_ignore = "x"will now requireatt_amend_desc(pkg_ignore = "x", update.config = TRUE), otherwise, it will fail. This allows for the use of parameters stored in the config file when runningatt_amend_desc()directly in the console.
Recommendation: Runatt_amend_desc(pkg_ignore = "x", update.config = TRUE)if you have to update your config, runatt_amend_desc()daily as you'll want to use what is stored in the config file. -
create_dependencies_file()gets parameterinstall_only_if_missing = FALSEby default to complete the installation instructions packages only if missing. (@MurielleDelmotte)
New features
att_amend_desc()can run with the last set of parameters stored in a configuration file, without having to call them all each time. See vignettes and documentation of parametersupdate.config = FALSE,use.config = FALSEandpath.c = "dev/config_attachment.yaml". (@dagousket)create_dependencies_file()now takes other sources into account (git, gitlab, github, bioc, local). (@MurielleDelmotte)- Use
create_dependencies_file(to = NULL)to only get the output as character and do not create a file
Bug fixes
v0.3.1
attachment 0.3.1
New features
find_remotes()now informs when using "r-universe" repositories.
Minor changes
- a new parameters
check_if_suggests_is_installedinatt_amend_desc()allow not to check if suggested package is installed. (thanks to @yogat3ch) create_renv_for_prod()dont look anymore for suggested packages- Clean a maximum of temp directories after examples and unit tests
v0.3.0: Merge pull request #63 from ThinkR-open/att-rebase-0.3
attachment 0.3.0
New features
find_remotes()andset_remotes_to_desc()now detects github, gitlab, git, bitbucket, local installations to add automatically to the "Remotes:" part of the DESCRIPTION file (@MurielleDelmotte)- Quarto documents can be parsed with
att_from_qmds()as an alias ofatt_from_rmds().
Minor changes
- Documentation for bookdown and quarto dependencies extraction updated
Bug fixes
- Allow to use dependencies after
att_amend_desc()#52 - Fix HTML5 issues with update to {roxygen2}
v0.2.5 - attachment - Develop with dependencies on {renv}
attachment 0.2.5
Major changes
- add
create_renv_for_dev()andcreate_renv_for_prod()function to createrenv.lockfile based on development project (@VincentGuyader and @statnmap). - Quarto documents can be parsed with
att_from_rmds(). - Documentation for bookdown and quarto dependencies extraction updated
Minor changes
att_amend_desc()now saves file before processing- Newline escape code
\nwill not interfere with package discovery