@@ -42,17 +42,22 @@ lint <- function(filename, linters = NULL, cache = FALSE, ..., parse_settings =
42
42
itr <- 0
43
43
44
44
if (isTRUE(cache )) {
45
- cache <- settings $ cache_directory
46
- } else if (is.logical(cache )) {
47
- cache <- character (0 )
45
+ cache_dir <- settings $ cache_directory
46
+ } else if (is.character(cache )) {
47
+ cache_dir <- cache
48
+ } else {
49
+ cache_dir <- character (0 )
48
50
}
49
51
50
- if (length(cache )) {
51
- lint_cache <- load_cache(filename , cache )
52
+ if (length(cache_dir )) {
53
+ lint_cache <- load_cache(filename , cache_dir )
52
54
lints <- retrieve_file(lint_cache , filename , linters )
53
55
if (! is.null(lints )) {
54
56
return (exclude(lints , ... ))
55
57
}
58
+ cache = TRUE
59
+ } else {
60
+ cache = FALSE
56
61
}
57
62
58
63
for (expr in source_expressions $ expressions ) {
@@ -119,6 +124,7 @@ lint_package <- function(path = ".", relative_path = TRUE, ...) {
119
124
on.exit(clear_settings , add = TRUE )
120
125
121
126
names(settings $ exclusions ) <- normalizePath(file.path(path , names(settings $ exclusions )))
127
+ exclusions = force(settings $ exclusions )
122
128
123
129
files <- dir(
124
130
path = file.path(path ,
@@ -138,7 +144,7 @@ lint_package <- function(path = ".", relative_path = TRUE, ...) {
138
144
if (interactive()) {
139
145
message(" ." , appendLF = FALSE )
140
146
}
141
- lint(file , ... , parse_settings = FALSE )
147
+ lint(file , ... , parse_settings = FALSE , exclusions = exclusions )
142
148
}))
143
149
144
150
if (interactive()) {
0 commit comments