openpharma / roxylint

Lint 'roxygen2'-generated documentation
https://openpharma.github.io/roxylint
Other
17 stars 0 forks source link

not applicable method for `lint_sentence_case` applied to `NULL` error #4

Closed danielinteractive closed 1 year ago

danielinteractive commented 1 year ago

When running the roxylint on a package.R file, e.g. https://github.com/Genentech/jmpost/blob/main/R/jmpost-package.R, then I get the error that a not applicable method for lint_sentence_case was applied to NULL.

I guess the linting of the title field (and others) should be made conditional on its presence maybe.

dgkf commented 1 year ago

edit: accidentally posted in wrong thread, but I meant to respond here as well

Thanks @danielinteractive. These functions underwent a bit of turnover as I refined the interface. We might need to specifically handle the NULL case still.

dgkf commented 1 year ago

Just investigating this further. This seems to be a special case when using the roxygen2 keyword "_PACKAGE", which pulls a title and description from DESCRIPTION and doesn't have a "raw" doc string.

#' @keywords internal
"_PACKAGE"

So I think just handling this as a special case and avoiding reporting lints in this case is valid.