R/deprecated.R

Defines functions lintr_deprecated

#' Deprecated functions
#'
#' Functions that have been deprecated and replaced by newer ones. They will be removed in an
#' upcoming version of \pkg{lintr} and should thus not be used anymore.
#' @noRd
NULL

lintr_deprecated <- function(old, new = NULL, version = NULL,
                             type = "Function") {
  msg <- c(
    c(type, " ", old, " was deprecated"),
    if (length(version) > 0L) {
      c(" in lintr version ", version)
    },
    ". ",
    if (length(new) > 0L) {
      c("Use ", new, " instead.")
    }
  )
  msg <- paste0(msg, collapse = "")
  warning(msg, call. = FALSE, domain = NA)
}

Try the lintr package in your browser

Any scripts or data that you put into this service are public.

lintr documentation built on Nov. 7, 2023, 5:07 p.m.