I have a package with `./tests/testthat/test-style.R` and `R/style.R` and am trying to use the file/linter-specific exclusion setup described here: https://lintr.r-lib.org/articles/lintr.html#excluding-files-completely If I have a .lintr config at package-root with the contents: ``` linters: linters_with_defaults() exclusions: list( "tests/testthat/test-style.R" = list(semicolon_linter = Inf) ) ``` The following error arises: ``` Error in file_exclusion[[names2(file_exclusion) == ""]] : attempt to select less than one element in integerOneIndex ``` This results from the following call (from lintr::lint_dir): ``` path <- "/home/me/blah" files <- file.path(path, c("R/style.R", "tests/testthat.R", "tests/testthat/test-style.R")) exclusions <- list(list(semicolon_linter = Inf)) names(exclusions) <- file.path(path, "tests/testthat/test-style.R") lintr:::drop_excluded(files, exclusions) #> Error in file_exclusion[[names2(file_exclusion) == ""]] : #> attempt to select less than one element in integerOneIndex ``` Apologies if I've misunderstood this new exclusions syntax.
Activity
russHyde commentedon Jul 5, 2022
I note that someone has raised a related issue in #1413
russHyde commentedon Jul 5, 2022
Using current lintr-master (1a170f5) on the same R package
AshesITR commentedon Jul 11, 2022
Thanks for reporting. Can you test #1447 on your package just to be sure the bug is squashed for good?
russHyde commentedon Jul 12, 2022
Thanks. This works great.