Closed Bisaloo closed 4 years ago
I think this was just a typo/thinko. Let me know if the fix doesn't work.
@hadley I encountered the same problem using roxygen2 v7.0.2.
roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
#' Title
#' @param space
#'
#' @export
foo <- function (
source = c('AWI-CM-1-1-MR', 'BCC-CSM2-MR', 'CESM2', 'CESM2-WACCM',
'EC-Earth3', 'EC-Earth3-Veg', 'GFDL-ESM4', 'INM-CM4-8',
'INM-CM5-0', 'MPI-ESM1-2-HR', 'MRI-ESM2-0'),
limit = 10000L
){}
"
)
produces:
# $foo.Rd
# % Generated by roxygen2: do not edit by hand
# % Please edit documentation in ./<text>
# \name{foo}
# \alias{foo}
# \title{Title}
# \usage{
# foo(
# source = c("AWI-CM-1-1-MR", "BCC-CSM2-MR", "CESM2", "CESM2-WACCM", "EC-Earth3",
# "EC-Earth3-Veg", "GFDL-ESM4", "INM-CM4-8", "INM-CM5-0", "MPI-ESM1-2-HR", "MRI-ESM2-0"),
# limit = 10000L
# )
# }
# \arguments{
# \item{space}{}
# }
# \description{
# Title
# }
#
which is longer than 90 characters wide and produces a NOTE
❯ checking Rd line widths ... NOTE
Rd file 'foo.Rd':
\usage lines wider than 90 characters:
"EC-Earth3-Veg", "GFDL-ESM4", "INM-CM4-8", "INM-CM5-0", "MPI-ES
M1-2-HR", "MRI-ESM2-0"),
These lines will be truncated in the PDF manual.
out <- roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
#' Title
#' @param space
#'
#' @export
foo <- function (
source = c('AWI-CM-1-1-MR', 'BCC-CSM2-MR', 'CESM2', 'CESM2-WACCM',
'EC-Earth3', 'EC-Earth3-Veg', 'GFDL-ESM4', 'INM-CM4-8',
'INM-CM5-0', 'MPI-ESM1-2-HR', 'MRI-ESM2-0'),
limit = 10000L
){}
"
)
usage <- format(out[[1]]$get_section("usage"))
nchar(strsplit(usage, "\n")[[1]])
#> [1] 7 4 81 91 16 1 1
Created on 2020-03-09 by the reprex package (v0.3.0)
So the widest line is 91 characters which suggests an off-by-one error somewhere
I might be missing something but:
produces
which is longer than 90 characters wide and produces a
NOTE
roxygen2 6.1.99.9001
This does not happen with the current CRAN version of roxygen2.