Skip to content

Commit

Permalink
For fully ignored files, remove from lint_package prior to any further
Browse files Browse the repository at this point in the history
processing.
  • Loading branch information
mwaldstein authored and jimhester committed Dec 21, 2017
1 parent 9c92345 commit bc9662c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/lint.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ lint_package <- function(path = ".", relative_path = TRUE, ..., exclusions = NUL
on.exit(clear_settings, add = TRUE)

exclusions <- normalize_exclusions(c(exclusions, settings$exclusions), FALSE)
names(exclusions) <- file.path(path, names(exclusions))

files <- dir(
path = file.path(path,
Expand All @@ -168,6 +167,15 @@ lint_package <- function(path = ".", relative_path = TRUE, ..., exclusions = NUL
full.names = TRUE
)

# Remove fully ignored files to avoid reading & parsing
to_exclude <- vapply(seq_len(length(files)),
function(i) {
file <- files[i]
file %in% names(exclusions) && exclusions[[file]] == Inf
},
logical(1))
files <- files[!to_exclude]

lints <- flatten_lints(lapply(files,
function(file) {
if (interactive()) {
Expand Down

0 comments on commit bc9662c

Please sign in to comment.