Repository navigation
Conversation
Because this pull request edits tests/testthat/test-report_intercept.R, the lint-changed-files check lints the whole file and fails on the existing top-level `<<-` assignments (assignment_linter). They are intentional, since insight::get_data() needs the data in the global environment, so mark them with `# nolint` as elsewhere in the package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
1 file not reviewed
man/report.Rd: Generated file
What changed in this PR
Fixes a regression where filtering list-columns from data frames could drop down to a vector when only one supported column remained, causing report outputs to lose the dataset introduction and variable name.
Changes:
- Preserve data-frame structure during list-column filtering by keeping
drop = FALSEin both grouped and ungrouped paths. - Improve robustness of diagnostic/performance text and stabilize
lavaan/stanregtests by reducing snapshot brittleness. - Update CI workflows (coverage, random test order, R CMD check) and add ancillary repo hygiene updates (wordlist, link check exclude, docs tweaks).
| File | Description |
|---|---|
| vignettes/report_ai.Rmd | Small wording/spelling update in AI vignette text. |
| tests/testthat/test-report_intercept.R | Adjusts global assignments with lintr suppression and whitespace cleanup. |
| tests/testthat/test-report_diagnostics.R | Adds regression tests for lavaan fit text formatting and Bayesian diagnostic text generation. |
| tests/testthat/test-report.stanreg.R | Updates snapshot to disable diagnostics and adds posterior/diagnostic consistency test. |
| tests/testthat/test-report.lavaan.R | Replaces brittle snapshots with normalized/validated comparisons for GFI-related output. |
| tests/testthat/test-report.data.frame.R | Updates row-count assertions and adds regression test for single-column data-frame reporting. |
| tests/testthat/_snaps/windows/report.stanreg.md | Updates snapshot output to match new include_diagnostic = FALSE call. |
| tests/testthat/_snaps/windows/report.lavaan.md | Updates snapshots to reflect normalized <GFI> placeholder and corrected values. |
| lychee.toml | Excludes a Cloudflare-challenged URL from link checking. |
| inst/WORDLIST | Adds new accepted words used in docs/tests. |
| README.md | Adjusts GitHub stars badge link target. |
| README.Rmd | Adjusts GitHub stars badge link target (source Rmd). |
| R/report_performance.R | Fixes formatting to preserve sign/integer part when rendering fit indices. |
| R/report_parameters.R | Supports multiple ESS column conventions and improves only_when_insufficient filtering. |
| R/report.data.frame.R | Ensures list-column filtering retains a data frame via drop = FALSE. |
| NEWS.md | Documents the data-frame preservation fix and diagnostic formatting improvements. |
| .github/workflows/test-coverage.yml | Replaces reusable workflow with an explicit Windows coverage workflow and RStan pins. |
| .github/workflows/check-random-test-order.yml | Adds explicit randomized test-order workflow with reporting. |
| .github/workflows/R-CMD-check.yml | Replaces reusable workflow with explicit compatibility-matrix checks and dependency pinning. |
| .Rbuildignore | Excludes lychee.toml from package builds. |
Review effort: Lite
| ) | ||
| expect_identical(unique(as.data.frame(result)$Variable), names(data)[1]) | ||
| expect_identical( | ||
| unique(summary(as.data.frame(result))$Variable), |
| expect_match( | ||
| as.character(result), | ||
| "The data contains 5 observations of the following 1 variables:", | ||
| fixed = TRUE | ||
| ) | ||
| expect_match( | ||
| as.character(result), |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #620 +/- ##
===========================================
+ Coverage 72.36% 87.31% +14.94%
===========================================
Files 54 55 +1
Lines 3684 5044 +1360
===========================================
+ Hits 2666 4404 +1738
+ Misses 1018 640 -378 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Filtering list columns dropped a single remaining column to a vector. A one-column data frame then lost the dataset introduction and variable name in reports.
Keep
drop = FALSEin both filtering paths. Regression tests cover single numeric and factor columns, plus a data frame reduced to one supported column after removing a list column, checking full and summary tables.Validation: All data-frame tests pass, including 12 new assertions; changed R files have no lint findings.
Broader verification with all seven fixes combined: installed-package tests reported 757 passing expectations, 0 test warnings, and 17 skips. The only 2 failures are lavaan snapshots also reproduced on unchanged
main(622 passing expectations).R CMD checkpassed code, documentation, examples, and vignette-code checks; it retains the baseline snapshot error and 2 warnings because vignettes were intentionally not built. Independent review andgit diff --checkpassed.CI investigation: the changed-files lint job uses a newer
expect_shape_linterand scans the entire touched test file. Replaced seven existing row-count assertions with compatibleexpect_length()checks, preserving testthat >= 3.2.1 support. All 38 data-frame assertions pass; Air and the exact CI lintr revision (82589b5) pass for the changed R files. Shared dependency, Stan, and existing snapshot failures remain in the full matrix.