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
3 open issues
1 file not reviewed
man/report.Rd: Generated file
What changed in this PR
This PR fixes failures in report()/report_statistics() stemming from dropped or partially matched degrees-of-freedom columns (notably for survey logistic models), and improves performance reporting by reusing provided tables instead of refitting/recomputing diagnostics.
Changes:
- Preserve/lookup
df_errorcorrectly for t-statistics (with legacydffallback) and omit df text when unavailable. - Reuse supplied performance tables to avoid redundant
report_table()recomputation and duplicate diagnostics. - Add/adjust tests and snapshots for SEM fit formatting, Bayesian diagnostics ESS columns, survey GLM df handling, and CI workflows.
| File | Description |
|---|---|
| vignettes/report_ai.Rmd | Doc wording tweak for report_ai() narrative. |
| tests/testthat/test-report_intercept.R | Lint suppression for intentional global assignments and whitespace cleanup. |
| tests/testthat/test-report_diagnostics.R | New unit tests for lavaan fit text formatting and Bayesian diagnostics ESS handling. |
| tests/testthat/test-report.stanreg.R | Snapshot updated to disable diagnostics; adds assertions aligning diagnostics with fitted posterior. |
| tests/testthat/test-report.lavaan.R | Snapshot normalization for version-varying GFI; adds fitted-value consistency checks. |
| tests/testthat/test-model-statistic-df.R | New tests for exact df column lookup, survey t-test df retention, and performance table reuse. |
| tests/testthat/_snaps/windows/report.survreg.md | Snapshot updated to remove duplicated diagnostics output. |
| tests/testthat/_snaps/windows/report.stanreg.md | Snapshot updated for include_diagnostic = FALSE output. |
| tests/testthat/_snaps/windows/report.lmer.md | Snapshot updated to remove duplicated diagnostics output. |
| tests/testthat/_snaps/windows/report.lavaan.md | Snapshot updated to normalize GFI rendering and reflect new print calls. |
| tests/testthat/_snaps/windows/report.ivreg.md | Snapshot updated to remove duplicated standardization message. |
| lychee.toml | Excludes r-universe URL that returns a Cloudflare JS challenge. |
| inst/WORDLIST | Adds new terms used in docs/tests (e.g., LLM/LLMs, suboptimal). |
| README.md | Updates stars badge link target. |
| README.Rmd | Updates stars badge link target (source Rmd). |
| R/report_performance.R | Fixes formatting to preserve sign/integer part (avoids truncating first character). |
| R/report_parameters.R | Updates Bayesian diagnostics text to support ESS_tail/ESS_bulk and legacy ESS. |
| R/report.lm.R | Fixes df handling for t-statistics and reuses supplied performance tables. |
| NEWS.md | Documents df fix, performance reuse, and diagnostics formatting changes. |
| DESCRIPTION | Adds survey to Suggests for survey model support/testing. |
| .github/workflows/test-coverage.yml | Replaces reused workflow with in-repo workflow steps and Windows coverage run. |
| .github/workflows/check-random-test-order.yml | Adds explicit Windows job to run tests in randomized file order. |
| .github/workflows/R-CMD-check.yml | Replaces reused workflow with explicit matrix, compatibility pins, and stricter checks. |
| .Rbuildignore | Excludes lychee.toml from package builds. |
Review effort: Lite
| stability <- effectsize::interpret_ess(ess, ...) | ||
| stability_text <- c( | ||
| "TRUE TRUE" = " and the indices are reliable", | ||
| "TRUE FALSE" = " even though the indices appear as reliable", | ||
| "FALSE TRUE" = " but the indices are unreliable", | ||
| "FALSE FALSE" = " and the indices are unreliable" | ||
| )[paste( | ||
| stability == "sufficient", | ||
| convergence == "converged" | ||
| )] | ||
| text_output <- paste0( | ||
| text_output, | ||
| stability_text, | ||
| " (", | ||
| ess_label, | ||
| " = ", | ||
| insight::format_value(ess, digits = 0), | ||
| ")" | ||
| ) |
| "t(30) = ", | ||
| fixed = TRUE | ||
| ) | ||
| expect_no_warning(report(model)) |
| R_KEEP_PKG_SOURCE: yes | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #618 +/- ##
===========================================
+ Coverage 72.36% 87.37% +15.00%
===========================================
Files 54 55 +1
Lines 3684 5046 +1362
===========================================
+ Hits 2666 4409 +1743
+ Misses 1018 637 -381 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Survey logistic models return t statistics, but
report_table()removed theirdf_errorcolumn, causingreport()to fail informat_value(NULL). Retain degrees of freedom for t tests, use exact column lookups (with a legacydffallback), and omit unavailable df without changing the statistic's distribution. Reuse supplied performance tables to avoid redundant refits and repeated diagnostics.Adds survey integration and linear-model regressions, including strict partial-match warnings and supplied-table reuse. Updates mixed-model and survival snapshots only to remove duplicate diagnostics.
Fixes #613. Fixes #228.
Validation: Targeted model, intercept, performance, and statistics tests pass, including 8 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: updated the optional
ivregsnapshot to expect one standardization message, matching the reused performance table. The affected linear, mixed, IV, survival, and survey test files pass locally. The full matrix also exposes failures shared by independent PRs: Stan compilation before reporting code runs, existing lavaan/stanreg snapshot drift, and optional-dependency resolution on R 4.2–4.4. These remain separate from this fix.