From 26820ed1b285d6867f952171d17013f1b77b739f Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Fri, 1 May 2026 18:02:05 +0100 Subject: [PATCH 1/4] fix news --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 24b117a..9969af1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # resultcheck (development version) -* `snapshot()` now uses `rstudioapi::getSourceEditorContext()$path` (in RStudio) as the primary method to detect the calling script name, falling back to the call stack and then `"interactive"`. +* `snapshot()` now uses `rstudioapi::getSourceEditorContext()$path` (in RStudio/Positron) as the primary method to detect the calling script name, falling back to the call stack and then `"interactive"`. * `snapshot()` and `serialize_value()` now apply built-in class-based method defaults automatically when no explicit `method` argument is provided. Statistical model classes (e.g. `lm`, `glm`, `coxph`, `kmeans`) are serialized using `broom::tidy`, `broom::glance`, and/or `broom::augment` when the `broom` package is available. * When `broom` is not installed, built-in class defaults that rely on it are silently skipped and the `print` + `str` fallback is used. User-configured class defaults that reference unavailable packages still raise an error. * The full list of supported classes is in `inst/extdata/snapshot-method-defaults.R`. From 4180bff183797783f7d947f26ed3d2b1bdd6ed03 Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Sun, 3 May 2026 11:03:57 +0100 Subject: [PATCH 2/4] update cran-comments.md --- cran-comments.md | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 5084f05..efd343b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,28 +1,23 @@ ## R CMD check results -0 errors | 0 warnings | 1 note +0 errors | 0 warnings | 0 notes -* This is a new release. +## Release summary -## Response to CRAN reviewer comments +This is an update (0.1.4 → 0.2.0) that adds built-in class-based snapshot method defaults, improved script name detection, and fixes two Windows-specific bugs that caused test failures only under `R CMD check` (not via `testthat::test_local()` with pkgload). -> If there are references describing the methods in your package, please add -> these in the description field of your DESCRIPTION file in the form -> authors (year) +## Key changes since 0.1.4 -The package implements an original snapshot-testing workflow for empirical R projects. To the best of our knowledge, there are no published references (papers, preprints, or books) describing these methods. Therefore, no references have been added to the Description field. +* `snapshot()` and `serialize_value()` now apply built-in class-based method defaults automatically when no explicit `method` argument is provided. Statistical model classes (e.g. `lm`, `glm`, `coxph`, `kmeans`) use `broom::tidy`, `broom::glance`, and/or `broom::augment` when broom is available. If broom is not installed, these defaults are silently skipped and the `print` + `str` fallback is used. User-configured class defaults that reference unavailable packages still raise an error. The full list of supported classes is in `inst/extdata/snapshot-method-defaults.R`. -> Please replace `\\dontrun{}` wrappers for executable examples and avoid writing -> by default/in examples to the user's home filespace. +* `snapshot()` now defaults to both `print` and `str` when no method is specified and no class-based default applies. -Addressed. Examples no longer write to the user’s home directory and no longer use \dontrun{}. +* Improved script name detection: `snapshot()` now uses `rstudioapi::getSourceEditorContext()$path` (in RStudio/Positron) as the primary method to detect the calling script name, falling back to a call-stack walk and then `"interactive"`. -* Replaced prior `\dontrun{}` examples with executable examples that run inside - `with_example()`, which creates and uses a temporary project under `tempdir()` - and cleans up automatically. -* Added support for empty sandboxes via `setup_sandbox()` (no argument needed), - and updated examples/docs accordingly. -* During examples, all snapshot writes are confined to the temporary project created under `tempdir()`. -* Outside examples, snapshot files are only written in interactive use. In such cases, the user is explicitly notified of the target file path before any write or update occurs. -* The snapshot directory is user-configurable via `_resultcheck.yml` using `snapshot.dir` (default: `tests/_resultcheck_snaps` under the project root). -* Interactive mismatch demonstrations remain behind `if (interactive())`. +* Added "Get Started" vignette covering the typical workflow (project setup, snapshot creation/update, sandbox testing). + +* Added FAQ vignette covering common questions (tracking snapshot changes over time, dependency-driven result drift, git integration). + +* Fixed a Windows-specific bug in `detect_script_name()` where `normalizePath()` produced backslash separators that did not match the forward-slash paths produced by `dirname()`, causing the call-stack frame filter to never skip package-internal frames. Tests now pass identically on Windows and Linux/macOS. + +* Fixed a bug in `with_example()` where reference snapshots were serialized outside the example project directory, causing `find_root()` to fail and skip the built-in class defaults. This produced a method-resolution mismatch between the reference snapshot and the snapshot created by `snapshot()` inside the sandbox. From 5050672a73c3fc1230f54a75b9ccf9f6dde0d799 Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Sun, 3 May 2026 11:07:26 +0100 Subject: [PATCH 3/4] Bump to 0.2.0 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 15ea7fe..88bd3b5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: resultcheck Title: Result Stability Checks for Empirical R Projects -Version: 0.1.4.9000 +Version: 0.2.0 Authors@R: person("Dianyi", "Yang", , "dianyi.yang@politics.ox.ac.uk", role = c("aut", "cre", "ctb"), comment = c(ORCID = "0009-0004-4652-3429")) Description: diff --git a/NEWS.md b/NEWS.md index 9969af1..73d8296 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# resultcheck (development version) +# resultcheck 0.2.0 * `snapshot()` now uses `rstudioapi::getSourceEditorContext()$path` (in RStudio/Positron) as the primary method to detect the calling script name, falling back to the call stack and then `"interactive"`. * `snapshot()` and `serialize_value()` now apply built-in class-based method defaults automatically when no explicit `method` argument is provided. Statistical model classes (e.g. `lm`, `glm`, `coxph`, `kmeans`) are serialized using `broom::tidy`, `broom::glance`, and/or `broom::augment` when the `broom` package is available. From ce0201b86dc0773fadc3d29f8ac63378a758760a Mon Sep 17 00:00:00 2001 From: Dianyi Yang Date: Sun, 3 May 2026 11:08:34 +0100 Subject: [PATCH 4/4] update CRAN-SUBMISSION --- CRAN-SUBMISSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index ef8332e..996ac11 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.1.4 -Date: 2026-04-14 12:24:50 UTC -SHA: 86bc746ff2af85f52a9f1d46969a544e9a5ca558 +Version: 0.2.0 +Date: 2026-05-03 10:08:20 UTC +SHA: 5050672a73c3fc1230f54a75b9ccf9f6dde0d799