You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
linters: linters_with_defaults(
line_length_linter(100)
)
exclusions:list(
"bad.R"=list(
1, # global exclusions are unnamedline_length_linter=4:6
)
)
Error message when running lint_dir():
$ Rscript -e 'lintr::lint_dir(".")'
Error in file_exclusion[[names2(file_exclusion) == ""]] :
attempt to select less than one element in integerOneIndex
Calls: <Anonymous> ... drop_excluded -> vapply -> FUN -> is_excluded_file -> %in%
Execution halted
To reproduce: run Rscript -e 'lintr::lint_dir(".")' from a directory containing the .lintr file above, and the following bad.R:
tmp="value"# regular comment# really long comment ............................................................................................................# really long comment ............................................................................................................# really long comment ............................................................................................................# regular comment
The text was updated successfully, but these errors were encountered:
Thanks for your testing. The bug you found is triggered whenever exclusions: in the .lintr config contains more than one instruction for a single file.
The only workaround I see is to put some of the exclusion directives directly into the file using nolint comments.
Even after the documentation fix for #1401, when using the 3.0.0 CRAN release of lintr, implementing the example in https://lintr.r-lib.org/articles/lintr.html#excluding-lines-via-the-config-file results in an unexpected error:
Error message when running
lint_dir()
:To reproduce: run
Rscript -e 'lintr::lint_dir(".")'
from a directory containing the.lintr
file above, and the followingbad.R
:The text was updated successfully, but these errors were encountered: