diff --git a/.lintr b/.lintr index 7640abc9..27c6bef4 100644 --- a/.lintr +++ b/.lintr @@ -1,8 +1,7 @@ -linters: with_defaults( - line_length_linter = NULL, - object_usage_linter = NULL, - object_length_linter = NULL, - camel_case_linter = NULL, - object_name_linter = NULL, - commented_code_linter = NULL, +linters: linters_with_defaults( + line_length_linter = NULL, + object_usage_linter = NULL, + object_length_linter = NULL, + object_name_linter = NULL, + commented_code_linter = NULL, cyclocomp_linter = NULL) diff --git a/DESCRIPTION b/DESCRIPTION index f9af83be..30f2034d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,7 +25,7 @@ Imports: collections (>= 0.3.0), fs (>= 1.3.1), jsonlite (>= 1.6), - lintr (>= 2.0.1), + lintr (>= 3.0.0), parallel, R6 (>= 2.4.1), roxygen2 (>= 7.0.0), @@ -48,5 +48,5 @@ ByteCompile: yes Encoding: UTF-8 NeedsCompilation: yes Roxygen: list(markdown = TRUE, r6 = FALSE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 Config/testthat/edition: 3 diff --git a/R/diagnostics.R b/R/diagnostics.R index 2333d876..7a364e00 100644 --- a/R/diagnostics.R +++ b/R/diagnostics.R @@ -5,17 +5,6 @@ #' @name diagnostics NULL - -#' Check if lintr is 2.0.1.9000 above. A number of features relies on it. -#' @noRd -lintr_is_new_enough <- function() { - return( - utils::packageVersion("lintr") >= "2.0.1.9000" && - "text" %in% names(formals(lintr::lint)) - ) -} - - DiagnosticSeverity <- list( Error = 1, Warning = 2, @@ -95,19 +84,7 @@ diagnose_file <- function(uri, is_rmarkdown, content, cache = FALSE) { content <- c(content, "") } - if (lintr_is_new_enough()) { - lints <- lintr::lint(path, cache = cache, text = content) - } else { - # TODO: remove it once new version of lintr is released - linter_file <- find_config(path) - if (!is.null(linter_file)) { - op <- options(lintr.linter_file = linter_file) - on.exit(options(op)) - } - text <- paste0(content, collapse = "\n") - lints <- lintr::lint(text, cache = cache) - } - + lints <- lintr::lint(path, cache = cache, text = content) diagnostics <- lapply(lints, diagnostic_from_lint, content = content) names(diagnostics) <- NULL diagnostics diff --git a/man/languageserver-package.Rd b/man/languageserver-package.Rd index 9df61729..871e8483 100644 --- a/man/languageserver-package.Rd +++ b/man/languageserver-package.Rd @@ -6,7 +6,7 @@ \alias{languageserver-package} \title{languageserver: Language Server Protocol} \description{ -An implementation of the Language Server Protocol for R. The Language Server protocol is used by an editor client to integrate features like auto completion. See for details. +An implementation of the Language Server Protocol for R. The Language Server protocol is used by an editor client to integrate features like auto completion. See \url{https://microsoft.github.io/language-server-protocol/} for details. } \details{ An implementation of the Language Server Protocol for R