Skip to content

Fix package detection for quoted function calls - #306

Closed
LeonidasZhak wants to merge 1 commit into
pharmaverse:mainfrom
LeonidasZhak:fix/backtick-function-package-detection-271
Closed

LeonidasZhak wants to merge 1 commit into
pharmaverse:mainfrom
LeonidasZhak:fix/backtick-function-package-detection-271

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Fixes package detection for function calls written with explicit quotes, including replacement functions such as colnames<-.

Thanks to maintainers

Thanks for tracing this to the mismatch between the parsed token text and the names returned by namespace exports.

Issue or motivation

Closes #271. get_used_functions() currently reports `colnames<-` as !!! NOT FOUND !!! when it appears in explicit quoted call form, even though the same replacement function is available from base R.

Root cause

The parse data keeps the quotes in SYMBOL_FUNCTION_CALL text, while the search-path lookup contains canonical function names without those quotes. The direct string comparison therefore misses replacement functions called this way.

Change

get_used_functions() now normalizes quoted function-call tokens before resolving their package. I also added a regression test for the issue example and updated the NEWS entry.

While running the repository link check, two Pharmar white-paper links were found to redirect from www.pharmar.org to pharmar.org; those links were updated so the PR does not leave the existing link-check workflow failing.

Tests

  • Reproduced the issue on main: `colnames<-` was reported as !!! NOT FOUND !!!.
  • Focused regression assertion for `colnames<-` passed after the change.
  • styler::style_file(c("R/get.R", "tests/testthat/test-get.R", "vignettes/approved.Rmd"), dry = "on") passed.
  • spelling::spell_check_package() passed.
  • urlchecker::url_check() passed.
  • covr::package_coverage(quiet = TRUE) completed; package coverage was 91.12%.
  • R CMD build --no-manual --compact-vignettes=gs+qpdf . passed.
  • _R_CHECK_CRAN_INCOMING_REMOTE_=false R CMD check --no-manual --as-cran logrx_0.4.0.9000.tar.gz passed with one NOTE for the development version number.

Scope

This PR only changes package detection for quoted function calls and updates two redirected documentation URLs found by the repository link check. It does not change logging output structure, package approval logic, roxygen-generated files, README output, or pkgdown site files.

Repository checklist

  • The spirit of logrx is met in this Pull Request
  • Code is formatted according to the tidyverse style guide
  • Updated relevant unit tests or have written new unit tests
  • Creation/updates to relevant roxygen headers and examples are not needed for this internal parsing change
  • Ran devtools::document(); its unrelated generated-file changes were not included
  • pkgdown::build_site() is not needed because no rendered examples, reference entries, or site structure changed
  • Updated NEWS.md for the user-visible logging fix
  • Addressed updates needed for vignettes by fixing the redirected Pharmar links
  • Ran R CMD check locally and addressed errors and warnings
  • Linked the issue so that it closes after successful merging
  • Addressed all merge conflicts and resolved appropriately

@kodesiba

Copy link
Copy Markdown
Collaborator

@LeonidasZhak this is already being addressed in #301

@kodesiba kodesiba closed this Sep 14, 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.

Bug: Package detection failure for backtick-quoted functions in get_used_functions

2 participants