Skip to content

Use is_pkg_installed() directly#305

Closed
MichaelChirico wants to merge 2 commits intoinsightsengineering:mainfrom
MichaelChirico:patch-1
Closed

Use is_pkg_installed() directly#305
MichaelChirico wants to merge 2 commits intoinsightsengineering:mainfrom
MichaelChirico:patch-1

Conversation

@MichaelChirico
Copy link
Copy Markdown

testthat makes the cardx namespace available; this style results in ugly test log notes like:

• do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom.helpers"))
  is not TRUE (1): test-ard_regression_basic.R:1:1
• do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom")) is not
  TRUE (2): test-ard_proportion_ci.R:1:1, test-proportion_ci.R:1:1
• do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = c("aod", (1):
  test-ard_aod_wald_test.R:1:1

Signed-off-by: Michael Chirico <chiricom@google.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 14, 2025

✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.

@ddsjoberg
Copy link
Copy Markdown
Collaborator

Hi @MichaelChirico ! Thanks for cleaning this up! This was older syntax leftover from when the function was being called from another pkg, and it wasn't even exported (all pre-CRAN release). This is much easier on the eyes!

Can you reply to this post with the following text and I can merge?

I have read the CLA Document and I hereby sign the CLA

@MichaelChirico
Copy link
Copy Markdown
Author

Hmm sorry. Our lawyers are being very particular. I cannot sign the CLA until #309 is handled.

@edelarua edelarua mentioned this pull request Oct 7, 2025
13 tasks
ddsjoberg pushed a commit that referenced this pull request Nov 10, 2025
**What changes are proposed in this pull request?**
* Updated tests to use standalone function
`skip_if_pkg_not_installed()`.

Result of changes in
insightsengineering/standalone#27

Closes #306 

Incorporates changes from #305 #307 #308


--------------------------------------------------------------------------------

Pre-review Checklist (if item does not apply, mark is as complete)
- [x] **All** GitHub Action workflows pass with a ✅
- [x] PR branch has pulled the most recent updates from master branch:
`usethis::pr_merge_main()`
- [x] If a bug was fixed, a unit test was added.
- [x] If a new `ard_*()` function was added, it passes the ARD
structural checks from `cards::check_ard_structure()`.
- [x] If a new `ard_*()` function was added, `set_cli_abort_call()` has
been set.
- [x] If a new `ard_*()` function was added and it depends on another
package (such as, `broom`), `is_pkg_installed("broom")` has been set in
the function call and the following added to the roxygen comments:
`@examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg =
"broom""))`
- [x] Code coverage is suitable for any new functions/features
(generally, 100% coverage for new code): `devtools::test_coverage()`

Reviewer Checklist (if item does not apply, mark is as complete)

- [ ] If a bug was fixed, a unit test was added.
- [ ] Code coverage is suitable for any new functions/features:
`devtools::test_coverage()`

When the branch is ready to be merged:
- [ ] Update `NEWS.md` with the changes from this pull request under the
heading "`# cardx (development version)`". If there is an issue
associated with the pull request, reference it in parentheses at the end
update (see `NEWS.md` for examples).
- [ ] **All** GitHub Action workflows pass with a ✅
- [ ] Approve Pull Request
- [ ] Merge the PR. Please use "Squash and merge" or "Rebase and merge".
@ddsjoberg
Copy link
Copy Markdown
Collaborator

Updated in another PR, thanks!

@ddsjoberg ddsjoberg closed this Nov 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants