Skip to content

734 namespaced calls - #735

Open
dragosmg wants to merge 67 commits into
mainfrom
734-namespaced-calls
Open

734 namespaced calls#735
dragosmg wants to merge 67 commits into
mainfrom
734-namespaced-calls

Conversation

@dragosmg

@dragosmg dragosmg commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

This PR:

  • namespaces most of the calls from other packages (with a few exceptions)
  • enables parallel testing with testthat (Config/testthat/parallel: true)
    • the number of cores can be controlled with an environment variable (e.g. TESTTHAT_CPUS=7)
  • solves 2 documentation issues:
    • exports the following internal S3 methods (these should be exported - see https://roxygen2.r-lib.org/articles/rd-other.html#s3 ("You should, however, always @export S3 methods, even internal ones"):
      • eval_tidyselect_on_colvec.quosure()
      • eval_tidyselect_on_colvec.quosures()
      • expr_to_filter.quosure()
      • expr_to_filter.quosures()
    • fixes a partially documented args for an unexported function
  • exceptions from namespaced calls:

An unrelated problematic aspect: the use of .data as object name. I think we should restrict this to only mean {rlang}'s .data pronoun. (#755)

There are a couple of implicit agreements this PR relies on. Going forward we:

  • favour of namespaced calls (package::function()) and we only use non-namespaced calls for operators (or other relevant exceptions).
  • no more @importFrom directives in function files. All should be centralised in the package doc.

fixes #734

dragosmg and others added 30 commits July 21, 2026 14:37
All dplyr function calls are now namespace-qualified with dplyr::,
so explicit importFrom directives are no longer needed. vars() is
kept unqualified since internal NSE logic pattern-matches on the
literal call name (see comment in R/tfrmt-package.R).

Also fixes three call-as-value references that the earlier
namespacing pass missed (bare symbols passed to map()/safely()
rather than called directly):
- safely(select) -> safely(dplyr::select) in apply_tfrmt.R
- map_dbl(last) -> map_dbl(dplyr::last) in apply_page_plan.R
- map(select, ...) -> map(dplyr::select, ...) in tfrmt_sigdig.R
Also fixes two call-as-value references missed by earlier regex-based
namespacing: do.call("crossing", ...) in apply_col_plan.R and
reduce(crossing) in mock_tbl.R.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@dragosmg
dragosmg requested a review from alanahjonas95 July 28, 2026 11:58
@dragosmg
dragosmg marked this pull request as ready for review July 28, 2026 11:58
alanahjonas95
alanahjonas95 previously approved these changes Jul 29, 2026

@alanahjonas95 alanahjonas95 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks makes sense/ looks good :)

@github-actions

Copy link
Copy Markdown
Contributor

🦺 Coverage summary

badge

🟢 Merging PR #735 (3211c4f) into main (133b75f) will not change overall coverage.
🟢 Diff coverage is 97.4% (1334 out of 1369 modified lines are covered by tests).

Details

Files with changes in coverage

File name Coverage head Coverage base Δ
R/apply_frmt_methods.R 95.2% 95.6% -0.4 ⬇️
R/body_plan.R 93.3% 92.5% 0.8 ⬆️
R/display_insights.R 99.3% 99.2% 0.1 ⬆️
R/frmt_plans.R 87.4% 85.5% 1.9 ⬆️
R/frmt_utils.R 78.9% 80.1% -1.2 ⬇️
R/print_to_ggplot.R 85.7% 85.2% 0.5 ⬆️
R/tfrmt_layer.R 97.1% 97% 0.1 ⬆️
R/tfrmt_sigdig.R 95.8% 95.2% 0.6 ⬆️
R/tfrmt.R 96.6% 96.5% 0.1 ⬆️
Overall 97% 97% 0.0 🟰

Coverage for modified lines

File name Lines modified Lines tested Coverage Missing
R/JSON.R 62 62 100%
R/apply_col_plan.R 68 68 100%
R/apply_col_style_plan.R 110 110 100%
R/apply_footnote_meta.R 44 44 100%
R/apply_footnote_plan.R 36 36 100%
R/apply_frmt_methods.R 98 94 95.9% 356-359
R/apply_page_plan.R 104 104 100%
R/apply_row_grp_plan.R 96 96 100%
R/apply_table_frmt_plan.R 35 35 100%
R/apply_tfrmt.R 90 90 100%
R/big_n.R 16 16 100%
R/body_plan.R 28 28 100%
R/col_plan.R 16 15 93.8% 175
R/col_style_plan.R 9 8 88.9% 131
R/display_insights.R 62 62 100%
R/eval_tidyselect.R 3 3 100%
R/extract_data.R 9 9 100%
R/frmt_plans.R 20 20 100%
R/frmt_utils.R 62 41 66.1% 136, 365-369, 371, 375, 376, 379, 380, 382, 383, 388, 440-446
R/mock_tbl.R 92 92 100%
R/prep_card.R 4 4 100%
R/print_to_ggplot.R 38 34 89.5% 113, 114, 118, 119
R/print_to_gt.R 132 132 100%
R/shuffle_card.R 3 2 66.7% 60
R/struct_utils.R 27 27 100%
R/tfrmt.R 23 21 91.3% 347, 448
R/tfrmt_checks.R 18 18 100%
R/tfrmt_layer.R 14 14 100%
R/tfrmt_n_pct.R 1 1 100%
R/tfrmt_sigdig.R 49 48 98% 326
Total 1369 1334 97.4%

♻️ Comment updated with the latest results.

Created on 2026-07-29 with covr2gh v0.0.0.9041.

@dragosmg dragosmg self-assigned this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replace importFrom directives with namespaced calls

2 participants