Skip to content

Commit

Permalink
NOTE missing dependency on R >= 4.1.0 when using pipe or function
Browse files Browse the repository at this point in the history
shorthand in package code files.

git-svn-id: https://svn.r-project.org/R/trunk@87614 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Jan 22, 2025
1 parent a882c8c commit 1c4f5ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/library/tools/R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,24 @@ add_dummies <- function(dir, Log)
}
}
}

if(!is_base_pkg &&
!.package_metadata_has_depends_on_R_at_least(db, "4.1.0")) {
files <-
names(.package_code_using_R_4.1_syntax(dirname(dfile)))
if(length(files)) {
if(!any) noteLog(Log)
any <- TRUE
msg <- "Missing dependency on R >= 4.1.0 because package code uses the pipe |> or function shorthand \\(...) syntax added in R 4.1.0."
printLog(Log,
paste(c(strwrap(msg, indent = 2L, exdent = 2L),
" File(s) using such syntax:",
paste0(" ", .pretty_format(sort(files)))),
collapse = "\n"),
"\n")
}
}

if (!any) resultLog(Log, "OK")
## return (<never used in caller>):
db
Expand Down

0 comments on commit 1c4f5ee

Please sign in to comment.