-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
blocked-internalFulfillment of this issue is blocked until another lintr issue is finishedFulfillment of this issue is blocked until another lintr issue is finishedfeaturea feature request or enhancementa feature request or enhancementroxygen2Linting package documentationLinting package documentation
Milestone
Description
Example code should be well formatted.
I hand't though about this until I started using 1.0.1, and it noticed a lot of trailing line spaces in the Roxygen comments, but I noticed that there aren't any checks for the actual example code.
For example:
#' show head and return summary
#'
#' @param bar an object
#'
#' @return summary of \code{bar}
#' @export
#'
#' @examples
#' ThisIsATerribleVariable = 6:20
#' foo( ThisIsATerribleVariable )
#'
foo <- function(bar){
print(head(bar))
return(summary(bar))
}I would expect lintr to flag line 9 for snake_case and <- not =, and line 10 for space around code in parentheses. In stead, all that I get is line 11, for trailing whitespace.
MichaelChirico and pawelru
Metadata
Metadata
Assignees
Labels
blocked-internalFulfillment of this issue is blocked until another lintr issue is finishedFulfillment of this issue is blocked until another lintr issue is finishedfeaturea feature request or enhancementa feature request or enhancementroxygen2Linting package documentationLinting package documentation