clessn / wikirest

Get data from the Wikimedia REST API
Other
1 stars 0 forks source link

Identify internal function according to tidyverse style guide #7

Closed judith-bourque closed 1 year ago

judith-bourque commented 1 year ago

According to tidyverse style guide,

"Internal functions should be documented with #' comments as per usual. Use the @noRd tag to prevent .Rd files from being generated."

#' Drop last
#'
#' Drops the last element from a vector.
#'
#' @param x A vector object to be trimmed.
#'
#' @noRd
judith-bourque commented 1 year ago

With @noRd, I get this warning

❯ checking for missing documentation entries ... WARNING
  Undocumented code objects:
    ‘get_metrics’
  All user-level objects in a package should have documentation entries.
  See chapter ‘Writing R documentation files’ in the ‘Writing R
  Extensions’ manual.

0 errors ✔ | 1 warning ✖ | 0 notes ✔

It's present even when I add #' @keywords internal

judith-bourque commented 1 year ago

Could removing the @export tag from internal functions allow @noRd to pass R CMD check?

judith-bourque commented 1 year ago

Internal function documentation example:

#' Drop last
#'
#' Drops the last element from a vector.
#'
#' @param x A vector object to be trimmed.
#'
#' @keywords internal
#' 
#' @noRd # Prevents an Rd from appearing

To prevent the function from being available to users, remove @export.

judith-bourque commented 1 year ago

Task for each function

Internal functions

Commit message: Add no Rd, remove export for