-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add parsable-roxygen hook #563
base: main
Are you sure you want to change the base?
Add parsable-roxygen hook #563
Conversation
Sorry @owenjonesuob for the delay. Here's my review:
Can you tell me when a warning would be issued? Depending on that, maybe a flag
What speaks against it? Is it slower? I guess it requires the package to be loadable with #' Initiate a pre-commit config file
#'
#' @param verbose way. `r 1+++++`
my_fun <- function(...) NULL But |
- id: parsable-roxygen | ||
name: parsable-roxygen | ||
description: check if roxygen comments in a .R file are parsable | ||
entry: Rscript /inst/hooks/exported/parsable-roxygen.R |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entry: Rscript /inst/hooks/exported/parsable-roxygen.R | |
entry: Rscript inst/hooks/exported/parsable-roxygen.R |
This must be a relative path, compare to other hooks.
#' some_function(11) | ||
#' | ||
#' @export | ||
some_function <- function(x) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the roxygen comment more minimal here since you want to test is parsing R code?
As discussed in #562.
Things to note:
roxygen2::parse_file()
does actually parse the file, I think we have to allow this hook to fail in two ways:parsable-R
roxygen2::parse_file(..., env = NULL)
- unless you can think of some reason why we would need to evaluate?Closes #562.