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

FR: Improve warning stacking when documenting a package without the Suggests intalled. #1480

Closed
olivroy opened this issue May 3, 2023 · 1 comment

Comments

@olivroy
Copy link
Contributor

olivroy commented May 3, 2023

Hello,
I was wondering if it was possible to improve the stacking of warnings when a suggested package is not installed.

For example, I am re-documenting ggplot2 using devtools::document(), and I don't have the mapproj, Hmisc, interp, multcomp, quantreg, akima.

Would it be possible to have a more legible message.

devtools::document()
There were 13 warnings (use warnings() to see them)
# currently
warnings()
Warning messages:
1: [coord-map.R:32] @param refers to unavailable topic mapproj::mapproject
Caused by error in `find.package()`:
! there is no package calledmapproj2: [coord-map.R:34] @param refers to unavailable topic mapproj::mapproject
Caused by error in `find.package()`:
! there is no package calledmapproj3: [coord-map.R:38] @param refers to unavailable topic mapproj::mapproject
Caused by error in `find.package()`:
! there is no package calledmapproj4: [fortify-multcomp.R:3] @param refers to unavailable topic multcomp::cld
Caused by error in `find.package()`:
! there is no package calledmultcomp5: [geom-contour.R:3] @description refers to unavailable topic
interp::interp
Caused by error in `find.package()`:
! there is no package calledinterp6: [geom-contour.R:3] @description refers to unavailable topic
akima::bilinear
Caused by error in `find.package()`:
! there is no package calledakima7: [labeller.R:325] @details refers to unavailable topic Hmisc::capitalize
Caused by error in `find.package()`:
! there is no package calledHmisc8: [stat-quantilemethods.R:3] @param refers to unavailable topic
quantreg::rq
Caused by error in `find.package()`:
! there is no package calledquantreg9: [stat-quantilemethods.R:3] @param refers to unavailable topic
quantreg::rqss
Caused by error in `find.package()`:
! there is no package calledquantreg10: [stat-summary.R:223] @description refers to unavailable topic
Hmisc::smean.cl.boot
Caused by error in `find.package()`:
! there is no package calledHmisc11: [stat-summary.R:223] @description refers to unavailable topic
Hmisc::smean.cl.normal
Caused by error in `find.package()`:
! there is no package calledHmisc12: [stat-summary.R:223] @description refers to unavailable topic
Hmisc::smean.sdl
Caused by error in `find.package()`:
! there is no package calledHmisc13: [stat-summary.R:223] @description refers to unavailable topic
Hmisc::smedian.hilow
Caused by error in `find.package()`:
! there is no package calledHmisc

For example, it could be grouped by packages and file.
If multiple missing documentations within the same line or field, it would group them instead of creating multiple warnings

devtools::document()

#  proposed output
There were 7 warnings (use warnings() to see them)

warnings()
1:  [coord-map.R:32] @param refers to unavailable topic mapproj::mapproject
    [coord-map.R:34] @param refers to unavailable topic mapproj::mapproject
    [coord-map.R:38] @param refers to unavailable topic mapproj::mapproject
# Caused by error in `find.package()`: # (this line is not necessary)
! there is no package calledmapproj2: [fortify-multcomp.R:3] @param refers to unavailable topic multcomp::cld
! there is no package calledmultcomp3: [geom-contour.R:3] @description refers to unavailable topic interp::interp
! there is no package calledinterp4: [geom-contour.R:3] @description refers to unavailable topic akima::bilinear
! there is no package calledakima5: [labeller.R:325] @details refers to unavailable topic Hmisc::capitalize
! there is no package calledHmisc6: [stat-quantilemethods.R:3] @param refers to unavailable topics quantreg::rq and quantreg::rqss
! there is no package calledquantreg7: [stat-summary.R:223] @description refers to unavailable topics Hmisc::smean.cl.boot, Hmisc::smean.sdl, and Hmisc::smedian.hilow
! there is no package calledHmisc
olivroy added a commit to olivroy/roxygen2 that referenced this issue Jul 3, 2023
@hadley
Copy link
Member

hadley commented Nov 1, 2023

It would be much easier for me if you just installed those packages 😄 But seriously, figuring out how to aggregate these warnings would be a decent amount of work, and it goes against our recommendation to just install all the suggested packages.

@hadley hadley closed this as completed Nov 1, 2023
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

No branches or pull requests

2 participants