Skip to content

Commit 43b7d71

Browse files
MichaelChiricommaechler
authored andcommitted
Pass buffer to text= for clarity
1 parent 9953bc0 commit 43b7d71

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lisp/ess-r-flymake.el

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
;; Flymake is the built-in Emacs package that supports on-the-fly
2828
;; syntax checking. This file adds support for this in ess-r-mode by
2929
;; relying on the lintr package, available on CRAN and currently
30-
;; hosted at https://github.com/jimhester/lintr.
30+
;; hosted at https://github.com/r-lib/lintr.
3131

3232
;;; Code:
3333

@@ -76,28 +76,26 @@ each element is passed as argument to `lintr::linters_with_defaults'."
7676
(defvar-local ess-r--flymake-proc nil)
7777

7878
(defvar-local ess-r--lintr-file nil
79-
"Location of the .lintr file for this buffer.")
79+
"Location of the .lintr config file for this buffer.")
8080

8181
(defvar ess-r--flymake-def-linter
8282
(replace-regexp-in-string
8383
"[\n\t ]+" " "
8484
"esslint <- function(str, ...) {
85-
if (!suppressWarnings(require(lintr, quietly=T))) {
85+
if (!suppressWarnings(requireNamespace('lintr', quietly=TRUE))) {
8686
cat('@@error: @@`lintr` package not installed')
87+
} else if (packageVersion('lintr') <= '3.0.0') {
88+
cat('@@error: @@Need `lintr` version > v3.0.0')
8789
} else {
88-
if (packageVersion('lintr') <= '3.0.0') {
89-
cat('@@error: @@Need `lintr` version > v3.0.0')
90-
} else {
91-
tryCatch(lintr::lint(commandArgs(TRUE), ...),
92-
error = function(e) {
93-
cat('@@warning: @@', conditionMessage(e))
94-
})
95-
}
90+
tryCatch(lintr::lint(text=commandArgs(TRUE), ..., parse_settings=TRUE),
91+
error = function(e) {
92+
cat('@@warning: @@', conditionMessage(e))
93+
})
9694
}
9795
};"))
9896

9997
(defun ess-r--find-lintr-file ()
100-
"Return the absolute path to the .lintr file.
98+
"Return the absolute path to the .lintr config file.
10199
Check first the current directory, then the project root, then
102100
the package root, then the user's home directory. Return nil if
103101
we couldn't find a .lintr file."

0 commit comments

Comments
 (0)