diff --git a/R/methods.R b/R/methods.R index d8360f215..60d369c59 100644 --- a/R/methods.R +++ b/R/methods.R @@ -86,12 +86,20 @@ print.lints <- function(x, ...) { } if (isTRUE(settings$error_on_lint)) { - quit("no", 31L, FALSE) # nocov + stop(sprintf( + ngettext(length(x), + "Linting failed with %i issue", + "Linting failed with %i issues" + ), length(x) + ), call. = FALSE) } + } else if (use_rstudio_source_markers) { # Empty lints: clear RStudio source markers rstudio_source_markers(x) } + + invisible(x) } diff --git a/R/zzz.R b/R/zzz.R index b6527a30f..6efffe01a 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -269,7 +269,7 @@ settings <- NULL "n71nn28") , 54L - 13L), comment_bot = logical_env("LINTR_COMMENT_BOT") %||% TRUE, - error_on_lint = logical_env("LINTR_ERROR_ON_LINT") %||% FALSE + error_on_lint = logical_env("LINTR_ERROR_ON_LINT") %||% TRUE ) settings <<- list2env(default_settings, parent = emptyenv())