Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roxygen2 7.3.0 breaks NAMESPACE #313

Closed
jdblischak opened this issue Jan 16, 2024 · 3 comments · Fixed by #314
Closed

roxygen2 7.3.0 breaks NAMESPACE #313

jdblischak opened this issue Jan 16, 2024 · 3 comments · Fixed by #314

Comments

@jdblischak
Copy link
Collaborator

While working on #312, I noticed that the latest roxygen2 was deleting := from {data.table} and %>% from {dplyr} from NAMESPACE.

==> devtools::document(roclets = c('rd', 'collate', 'namespace'))

ℹ Updating gsDesign2 documentationpw_info.R:75: @importFrom Excluding unknown export in from data.table:
  `":="`.pwe.R:153: @importFrom Excluding unknown export in from dplyr: `"%>%"`.Loading gsDesign2pw_info.R:75: @importFrom Excluding unknown export in from data.table:
  `":="`.pwe.R:153: @importFrom Excluding unknown export in from dplyr: `"%>%"`.
Documentation completed

roxygen2 7.3.0 was recently released on 2024-01-11. Fortunately another developer has already reported the problem in r-lib/roxygen2#1570. While we wait on a fix, please build the documentation with roxygen2 7.2.3

@nanxstats
Copy link
Collaborator

😂 Nice findings. Will surely keep this in mind... Thanks!

To (re-)install roxygen2 7.2.3, one can use:

remotes::install_version("roxygen2", "7.2.3")

@olivroy
Copy link

olivroy commented Jan 16, 2024

Actually, you would fix those by replacing the lines with:

#' @importFrom data.table :=
#' @importFrom dplyr %>%

@jdblischak
Copy link
Collaborator Author

Actually, you would fix those by replacing the lines with:

@olivroy Thanks for the suggested workaround! While the roxygen2 developers are restoring the previous behavior in r-lib/roxygen2#1574, I tested and confirmed that @importFrom data.table := and @importFrom data.table %>% work as intended with both roxygen2 7.2.3 and 7.3.0.

I've always put quotes around these types of functions. This is how they display in NAMESPACE, and I thought I had got errors in the past when I didn't put them in quotes. Either I am misremembering, or roxgyen2 was updated to handle this common use case.

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 a pull request may close this issue.

3 participants