Skip to content

Commit c11fdc1

Browse files
committed
Allow users to set lintr.linter_file
This lets users specify the location of the linter file with options(lintr.linter_file) before calling lintr::lint(). This should be useful to allow the various plugins to specify the path to the .lintr file Related to r-lib#123 and r-lib#335
1 parent 89ec417 commit c11fdc1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/settings.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ find_config <- function(filename) {
5656
}
5757
linter_file <- getOption("lintr.linter_file")
5858

59+
## if users changed lintr.linter_file, return immediately.
60+
if (".lintr" != linter_file) return(linter_file)
61+
5962
path <- if (is_directory(filename)) {
6063
filename
6164
} else {

0 commit comments

Comments
 (0)