Skip to content

feat: Extend unused_function to other R package folders#374

Merged
etiennebacher merged 2 commits intomainfrom
unused-function-2
Feb 28, 2026
Merged

feat: Extend unused_function to other R package folders#374
etiennebacher merged 2 commits intomainfrom
unused-function-2

Conversation

@etiennebacher
Copy link
Owner

Check that functions defined in inst/tinytest, inst/tests, and tests are used in those folders. Note that while functions defined in R can be used in tests, the opposite is not true.

@github-actions github-actions bot added the forgot-changelog This PR adds changes that should be documented in CHANGELOG.md and docs/changelog.md. label Feb 28, 2026
@github-actions
Copy link

Ecosystem checks

Rdatatable/data.table: +1 -0 violations
New violations (first 100):
tests/autoprint.R[62:0]: unused_function -- `print.foo` is defined but never called in this package.  
ropensci/targets: +2 -0 violations
New violations (first 100):
tests/testthat/helper-aws.R[42:0]: unused_function -- `aws_s3_delete_targets_buckets` is defined but never called in this package.
tests/testthat/helper-gcp.R[13:0]: unused_function -- `gcp_gcs_delete_targets_buckets` is defined but never called in this package.  
rstudio/shiny: +2 -0 violations
New violations (first 100):
tests/testthat/helper.R[74:0]: unused_function -- `rewire_namespace_handler` is defined but never called in this package.
tests/testthat/test-stacks.R[112:0]: unused_function -- `dumpTests` is defined but never called in this package.  
tidyverse/dplyr: +1 -0 violations
New violations (first 100):
tests/testthat/helper-encoding.R[27:0]: unused_function -- `get_alien_lang_string` is defined but never called in this package.  
tidyverse/ggplot2: +2 -0 violations
New violations (first 100):
tests/testthat/test-facet-labels.R[18:0]: unused_function -- `get_labels_info.FacetGrid` is defined but never called in this package.
tests/testthat/test-facet-labels.R[31:0]: unused_function -- `get_labels_info.FacetWrap` is defined but never called in this package.  

@github-actions
Copy link

Benchmark on real-projects

Repository Avg. duration (main, seconds) Avg. duration (PR, seconds) PR - main PR - main (%) Number of iterations
easystats/datawizard 0.1966549 0.2021948 0.0055399244 2.8170798 50
lrberge/stringmagic 0.1820837 0.1812051 -0.0008786573 -0.4825567 50
pola-rs/r-polars 0.2499054 0.2559953 0.0060899545 2.4369042 50
Rdatatable/data.table 0.2333518 0.2358466 0.0024948052 1.0691177 50
ropensci/targets 0.4115552 0.4193643 0.0078090645 1.8974525 50
rstudio/shiny 0.2106204 0.2131868 0.0025663975 1.2184942 50
tidyverse/dplyr 0.2449498 0.2494984 0.0045485864 1.8569464 50
tidyverse/ggplot2 0.3735404 0.3796126 0.0060722614 1.6255972 50
vincentarelbundock/marginaleffects 0.2092290 0.2129781 0.0037491816 1.7919038 50
wch/r-source 1.8342253 1.8506964 0.0164710488 0.8979839 50

@etiennebacher etiennebacher merged commit 614a1a9 into main Feb 28, 2026
15 of 16 checks passed
@etiennebacher etiennebacher deleted the unused-function-2 branch February 28, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forgot-changelog This PR adds changes that should be documented in CHANGELOG.md and docs/changelog.md.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant