Skip to content

Commit

Permalink
tweaks to get is.R deprecation reported again
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@85876 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Feb 8, 2024
1 parent 7298851 commit e3e873e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/library/tools/R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -4099,7 +4099,8 @@ add_dummies <- function(dir, Log)
## particularly parallel cluster on Windows, hence a hack to retry after 2 sec:
lines <- tryCatch(suppressWarnings(readLines(exout, warn = FALSE)),
error = function(e){Sys.sleep(2); readLines(exout, warn = FALSE)})
bad_lines <- grep("^Warning: .*is deprecated.$",
## r85870 changed .Deprecated to report the call, hence changed msg
bad_lines <- grep("^Warning.*: .*is deprecated[.]$",
lines, useBytes = TRUE, value = TRUE)
if(length(bad_lines)) {
bad <- TRUE
Expand Down Expand Up @@ -4505,14 +4506,14 @@ add_dummies <- function(dir, Log)

## Packages with a 'vignette' subdir not providing vignettes.
if(!length(vigns$docs)) {
checkingLog(Log, "package vignettes")
checkingLog(Log, "package vignettes")
noteLog(Log)
msg <- c("Package has 'vignettes' subdirectory but apparently no vignettes.",
"Perhaps the 'VignetteBuilder' information is missing from the DESCRIPTION file?")
wrapLog(msg)
return()
}

if(do_install && !spec_install && !is_base_pkg && !extra_arch) {
## fake installs don't install inst/doc
checkingLog(Log, "for unstated dependencies in vignettes")
Expand Down Expand Up @@ -4752,7 +4753,7 @@ add_dummies <- function(dir, Log)
})
if(!inherits(products, "error") && length(products)) {
## Hmm ... there should really only be one tangle
## product.
## product.
lines <- readLines(file.path(tdir, products[1L]),
warn = FALSE)
if(!all(grepl("(^###|^[[:space:]]*$)", lines,
Expand All @@ -4768,7 +4769,7 @@ add_dummies <- function(dir, Log)
if(!is.na(rcp))
Sys.setenv("_R_CHECK_PACKAGE_NAME_" = rcp)
## Hopefully knitr::vtangle() will be fixed eventually ...
## </FIXME>
## </FIXME>
if(nb <- length(bad_vignettes)) {
if(!any) noteLog(Log)
any <- TRUE
Expand Down Expand Up @@ -5598,6 +5599,8 @@ add_dummies <- function(dir, Log)
## so filter out later.
"^Warning:",
## <FIXME>
## New form of warning in 4.4.0
"^Warning.*: .*is deprecated[.]$",
## New style Rd conversion
## which may even show errors:
"^Rd (warning|error): ",
Expand Down
4 changes: 2 additions & 2 deletions src/main/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ static void vwarningcall_dflt(SEXP call, const char *format, va_list ap)
else {
REprintf(_("Warning in %s :"), dcall);
if(!(noBreakWarning ||
( mbcslocale && 18 + wd(dcall) + wd(buf) <= LONGWARN) ||
(!mbcslocale && 18 + strlen(dcall) + strlen(buf) <= LONGWARN)))
( mbcslocale && 18 + wd(dcall) + wd(buf) >= LONGWARN) ||
(!mbcslocale && 18 + strlen(dcall) + strlen(buf) >= LONGWARN)))
REprintf("\n ");
}
REprintf(" %s\n", buf);
Expand Down

0 comments on commit e3e873e

Please sign in to comment.