Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# resultcheck (development version)
# resultcheck 0.2.0

* `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`.
Expand Down
33 changes: 14 additions & 19 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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) <doi:...>
## 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.
Loading