Changelog
Source:NEWS.md
sessioncheck 0.2.0
Improvements
Formatted output (from
print(),format(), and messages/warnings raised byaction = "message"/"warn") is now nicer to read, with a cli-like style.Messaging for
sessioncheck()and the individualcheck_*()functions is more informative and more consistent across checkers, including a clearer distinction between “missing” and “mismatched” for the options/locale/sysenv checks, and a dedicated message forcheck_sessiontime()(#5).
New features
Added
compare_sessionstates(), which reports how twosessionstate()snapshots differ – take a baseline snapshot, do some work, take another, and diff them. Returns an object of classsessioncheck_sessionstatediffwithformat(),print(), andas.data.frame()methods.Added
check_working_directory(), which checks the session’s working directory against an expected path (#11).Added an
action_on_passargument tosessioncheck()and the individualcheck_*()functions, allowing a clean result to be confirmed with a message rather than remaining silent (#10).Added
sessionstate(), a companion tosessioncheck()intended for use at the end of a script as an audit log. It reports platform details (R version, OS, matrix products, locale, timezone, UI/frontend), selected machine information fromSys.info(), session timing, RNG state, and an inventory of attached and loaded-namespace packages, similar tosessioninfo::session_info(). Returns an object of classsessioncheck_sessionstatewithformat(),print(), andas.data.frame()methods.
Bug fixes
- Fixed
.get_locale_list()(used bycheck_required_locale()) to handle the case whereSys.getlocale()returns a single unprefixed value instead of the usual"CATEGORY=value;..."format, which happens when every locale category shares the same setting. Previously this caused every requested category to be misreported as missing.
sessioncheck 0.1.1
CRAN release: 2026-07-28
Bug fixes
Fixed a broken roxygen2 comment in
check_loaded_namespaces()that caused the first sentence of the@detailshelp section to be silently dropped. The page previously opened mid-sentence with “(packages that have been loaded but not attached)…”; it now correctly reads “This checker inspects the list of loaded namespaces (packages that have been loaded but not attached)…”.Fixed argument validation in
sessioncheck()to run after merging theactionargument with any value set viaoptions(sessioncheck = ...). Previously, an invalidactionsupplied throughoptions()bypassed validation entirely and produced a confusing error message (the session-check results) rather than a clear “invalid action” error.Fixed a typo in the formatted output for locale check results: “Unexpected locale settings:” is now “Unexpected locale settings:”.
Fixed a silent failure in
check_required_options(),check_required_locale(), andcheck_required_sysenv()where an unnamedrequired_*list (e.g.,required_options = list(0L)) caused all checks to be silently skipped. Therequired_*arguments now require a named list when non-empty, and passing an unnamed list is an error.Fixed a latent bug in the internal
.action()helper where passing astatusobject of an unexpected class left the variableis_okundefined, causing an uninformativeobject 'is_ok' not founderror. The function now useselse ifbranching and raises an explicit “unexpected status class” error for unrecognized inputs.Fixed
sessioncheck()to validate thechecksargument. Previously, unrecognized check names (e.g. from a typo) were silently ignored; they now produce an error listing the valid check names.Fixed a misleading mock in the
sessioncheck()test suite: the mock for.get_locale_status()was returning a bare string instead of asessioncheck_statusobject, making the associated assertion meaningless. The mock now returns a properly-constructed status object.
Testing
- Added
spellingtoSuggestsand added a spell-check test (tests/testthat/test-spelling.R) so thatspelling::spell_check_package()runs automatically withdevtools::test(). The test is skipped on CRAN.
Documentation
Updated the
DESCRIPTIONto accurately reflect the full scope of the package. The previous description mentioned only the global environment and loaded namespaces; it now covers all eight check types (global environment, attached packages, loaded namespaces, attached environments, session run time, R options, locale settings, and system environment variables).Fixed the
@detailssection ofcheck_attached_packages(), which referred to the parameter asallowrather than its correct nameallow_attached_packages.Fixed the
@examplesblock ofcheck_required_locale(), which passedrequired = list(...)instead ofrequired_locale = list(...). The call worked only through R’s partial argument matching, which is fragile and misleading in documentation.Removed self-referential links from the
@seealsosection of each check function. Each function previously listed itself among the “see also” links.
sessioncheck 0.1.0
Initial CRAN release. The package provides tools for checking whether an R session is in a clean state. The main user-facing functions are:
-
check_globalenv_objects()— flags unexpected objects in.GlobalEnv. -
check_attached_packages()— flags non-base packages on the search path. -
check_loaded_namespaces()— flags non-base loaded namespaces. -
check_attached_environments()— flags non-package attachments on the search path. -
check_sessiontime()— flags sessions that have been running longer than a threshold (default 300 seconds). -
check_required_options()— flags R options that are absent or have unexpected values. -
check_required_locale()— flags locale categories that have unexpected values. -
check_required_sysenv()— flags system environment variables that are absent or have unexpected values. -
sessioncheck()— a top-level orchestrator that runs multiple checks in a single call.
All check functions accept an action argument ("warn", "error", "message", or "none") and return an invisible sessioncheck_status object. Default behavior and allowlists can be configured project-wide via options(sessioncheck = list(...)).