diff --git a/.lintr b/.lintr index e9a59a70..a9578238 100644 --- a/.lintr +++ b/.lintr @@ -4,7 +4,6 @@ linters: linters_with_defaults( object_length_linter(80), object_name_linter = NULL, object_usage_linter = NULL, - assignment_linter = NULL, brace_linter = NULL, commented_code_linter = NULL, cyclocomp_linter = NULL, diff --git a/R/aaa-globals.R b/R/aaa-globals.R index bc0f5f52..bf88baa6 100644 --- a/R/aaa-globals.R +++ b/R/aaa-globals.R @@ -5,32 +5,32 @@ ## Mutable values that might be modified by the user (code borrowed from knitr) # merge elements of y into x with the same names -merge_list = function(x, y) { - x[names(y)] = y +merge_list <- function(x, y) { + x[names(y)] <- y x } -new_defaults = function(value = list()) { - defaults = value +new_defaults <- function(value = list()) { + defaults <- value - get = function(name, default = FALSE, drop = TRUE) { - if (default) defaults = value # this is only a local version + get <- function(name, default = FALSE, drop = TRUE) { + if (default) defaults <- value # this is only a local version if (missing(name)) defaults else { if (drop && length(name) == 1) defaults[[name]] else { setNames(defaults[name], name) } } } - set = function(...) { - dots = list(...) + set <- function(...) { + dots <- list(...) if (length(dots) == 0) return() if (is.null(names(dots)) && length(dots) == 1 && is.list(dots[[1]])) if (length(dots <- dots[[1]]) == 0) return() defaults <<- merge(dots) invisible(NULL) } - merge = function(values) merge_list(defaults, values) - restore = function(target = value) defaults <<- target + merge <- function(values) merge_list(defaults, values) + restore <- function(target = value) defaults <<- target list(get = get, set = set, merge = merge, restore = restore) } diff --git a/R/hooks.R b/R/hooks.R index 410c11c7..6891d491 100644 --- a/R/hooks.R +++ b/R/hooks.R @@ -17,9 +17,9 @@ snapshotHook <- function(expr, value, ok, visible) { project <- .packrat_mutables$get("project") if (is.null(project)) { - file = "" ## to stdout + file <- "" ## to stdout } else { - file = file.path(project, "packrat", "packrat.log") + file <- file.path(project, "packrat", "packrat.log") } if (inherits(e, "simpleError")) { diff --git a/R/rstudio-protocol.R b/R/rstudio-protocol.R index b175710e..38a0d92d 100644 --- a/R/rstudio-protocol.R +++ b/R/rstudio-protocol.R @@ -12,4 +12,4 @@ # the protocol version number, is used to determine whether the package is too # old to be compatible. -.RStudio_protocol_version = 1 +.RStudio_protocol_version <- 1