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

broken @docType package documentation #1491

Closed
bastistician opened this issue Jun 29, 2023 · 7 comments · Fixed by weecology/ratdat#11, BayerSe/esback#9 or #1535
Closed

broken @docType package documentation #1491

bastistician opened this issue Jun 29, 2023 · 7 comments · Fixed by weecology/ratdat#11, BayerSe/esback#9 or #1535
Labels
bug an unexpected problem or unintended behavior rd ✍️
Milestone

Comments

@bastistician
Copy link
Contributor

bastistician commented Jun 29, 2023

roxygen2 7.0.0 (2019-11-12) had the breaking change

  • Using @docType package no longer automatically adds a -package alias.
    Instead document _PACKAGE to get all the defaults for package documentation

from 29db38f.

However, thousands of packages still use the old way (that was still recommended a year ago)

#' @docType package
#' @name pkgname
NULL

not being aware that they should

because they no longer automatically get that alias that is required for a package overview page to be found via package?pkgname. As a consequence, CRAN now has thousands of packages where this help request no longer works.

Could roxygen2 warn users when there is a @docType package block without corresponding @aliases (and possibly recommend the new _PACKAGE feature)?

@bastistician
Copy link
Contributor Author

bastistician commented Jul 24, 2023

Addendum: I noticed that some packages do use the "_PACKAGE" syntax introduced long ago via @krlmlr's #392, but explicitly remove the default aliases via @aliases NULL (e.g., krlmlr/enc@3ee7849) producing a help page without alias, unaccessible from dynamic help().

I think it would be very useful if roxygen2 actively warned its users about the breaking change from 7.0.0, i.e., when the old approach @docType package on NULL is used (without manually specifying @aliases pkgname-package) and recommend documenting "_PACKAGE". Maybe @krlmlr would have an idea?

@MichaelChirico
Copy link
Contributor

Just came to post the same -- the current warning is misleading, routing users to the more awkward #' @name pkgname-package approach:

[pkgname-package.R:10] Block must have a @name
ℹ Either document an existing object or manually specify with @name

The "_PACKAGE" sentinel approach strikes me as a bit redundant (we've already written #' @docType package), but if this is the requirement we should be steering users there more helpfully.

jonesor added a commit to jonesor/mpmsim that referenced this issue Aug 19, 2023
yihui added a commit to rstudio/markdown that referenced this issue Aug 19, 2023
olbapjose added a commit to olbapjose/FuzzyLP that referenced this issue Aug 19, 2023
Arreglando sugerencia de CRAN: 

You have file 'FuzzyLP/man/FuzzyLP.Rd' with \docType{package}, likely
intended as a package overview help file, but without the appropriate
PKGNAME-package \alias as per "Documenting packages" in R-exts.

This seems to be the consequence of the breaking change

  Using @doctype package no longer automatically adds a -package alias.
  Instead document _PACKAGE to get all the defaults for package
  documentation.

in roxygen2 7.0.0 (2019-11-12) having gone unnoticed, see
<r-lib/roxygen2#1491>.

As explained in the issue, to get the desired PKGNAME-package \alias
back, you should either change to the new approach and document the new
special sentinel

  "_PACKAGE"

or manually add

  @Aliases FuzzyLP-package   --> **esto es lo que hemos hecho**

if remaining with the old approach.
daattali added a commit to daattali/ddpcr that referenced this issue Aug 19, 2023
daattali added a commit to daattali/shinyjs that referenced this issue Aug 19, 2023
daattali added a commit to daattali/timevis that referenced this issue Aug 19, 2023
daattali added a commit to daattali/colourpicker that referenced this issue Aug 19, 2023
daattali added a commit to daattali/shinyalert that referenced this issue Aug 20, 2023
daattali added a commit to daattali/addinslist that referenced this issue Aug 20, 2023
daattali added a commit to daattali/shinycssloaders that referenced this issue Aug 20, 2023
daattali added a commit to daattali/shinybrowser that referenced this issue Aug 20, 2023
daattali added a commit to daattali/shinydisconnect that referenced this issue Aug 20, 2023
daattali added a commit to daattali/shinyscreenshot that referenced this issue Aug 20, 2023
@hadley
Copy link
Member

hadley commented Nov 16, 2023

Change was made in 29db38f as part of some other refactoring with comment " @docType package no longer adds -package alias as this broke encapsulation and was only mildly useful."

hadley added a commit that referenced this issue Nov 16, 2023
While recommending that you update to the newer syntax.

Fixes #1491
@hadley
Copy link
Member

hadley commented Nov 16, 2023

I'd appreciate someone would take a look at #1535 and confirm that the approach makes sense — the basic is to make @docType package essentially an alias for _PACKAGE (with deprecation message), ensuring that the behaviour of the two can no longer drift out of sync.

hadley added a commit that referenced this issue Nov 21, 2023
While recommending that you update to the newer syntax.

Fixes #1491
aldomann added a commit to biodosetools-team/biodosetools that referenced this issue Jan 9, 2024
hrlai added a commit to hrlai/novelforestSG that referenced this issue Jan 14, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 25, 2024
## v1.0.6
  * Fix new `-Wformat` warnings.

## v1.0.5
  * Address roxygen2 breaking changes:

  * Add explicit alias for `fansi-package` now that it is no longer
    auto-generated by roxgen2 from the [`@docType package`
    directive](r-lib/roxygen2#1491).
  * Work around [changed behavior for
    `@inheritParams`](r-lib/roxygen2#1515).
richardkwo added a commit to richardkwo/eff2 that referenced this issue Jan 26, 2024
richardkwo added a commit to richardkwo/eff2 that referenced this issue Jan 26, 2024
slager added a commit to ropensci/rvertnet that referenced this issue Feb 8, 2024
ruthkr added a commit to ruthkr/greatR that referenced this issue Feb 26, 2024
Robinlovelace added a commit to ropensci/stplanr that referenced this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd ✍️
Projects
None yet
3 participants