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.2.0
Date: 2026-05-03 10:08:20 UTC
SHA: 5050672a73c3fc1230f54a75b9ccf9f6dde0d799
Version: 0.2.1
Date: 2026-05-08 12:38:25 UTC
SHA: 3e0889603be442d0972de2abc8fe49d4aabeb944
4 changes: 2 additions & 2 deletions 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.2.0.9000
Version: 0.2.1
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 All @@ -13,7 +13,6 @@ Description:
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Imports:
withr,
rprojroot,
Expand All @@ -28,3 +27,4 @@ Suggests:
URL: https://github.com/kv9898/resultcheck/, https://kv9898.github.io/resultcheck/
BugReports: https://github.com/kv9898/resultcheck/issues
VignetteBuilder: knitr
Config/roxygen2/version: 8.0.0
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# resultcheck (development version)
# resultcheck 0.2.1

* `snapshot()` now improves script-name detection in non-interactive and test contexts by skipping editor-context lookup there and relying on call-stack source references before falling back to `"interactive"`.

Expand Down
18 changes: 3 additions & 15 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,8 @@

## Release summary

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).
This is a patch release (0.2.0 → 0.2.1) that fixes a bug in script name detection.

## Key changes since 0.1.4
## Key changes since 0.2.0

* `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`.

* `snapshot()` now defaults to both `print` and `str` when no method is specified and no class-based default applies.

* 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"`.

* 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.
* Fixed a bug in `detect_script_name()` where the script name was not correctly detected in certain calling contexts, causing snapshot files to be written to the wrong location.
Loading