Skip to content

Commit 08d66cd

Browse files
JhossePauljimhester
authored andcommitted
Adds addin_lint support for project configuration file
1 parent 1342aba commit 08d66cd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

R/addins.R

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ addin_lint <- function() {
33
if (filename$path == "") {
44
return("Current source has no path. Please save before continue")
55
}
6-
lintr::lint(filename$path)
6+
7+
config_file <- lintr:::find_config(filename$path)
8+
config <- read.dcf(config_file, all = T)
9+
config_linters <- gsub("\n", "", config[["linters"]])
10+
linters <- if (length(config_linters) == 0) {
11+
message("No configuration found. Using default linters.")
12+
default_linters
13+
} else {
14+
eval(parse(text = config_linters))
15+
}
16+
17+
lintr::lint(filename$path, linters = linters)
718
}
819

920
addin_lint_package <- function() {

0 commit comments

Comments
 (0)