Skip to content

Commit 60193c2

Browse files
use new globbing support from upstream
1 parent 331f5db commit 60193c2

File tree

1 file changed

+35
-40
lines changed

1 file changed

+35
-40
lines changed

.ci/.lintr.R

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -71,45 +71,40 @@ linters = c(dt_linters, all_linters(
7171
))
7272
rm(dt_linters)
7373

74-
# TODO(lintr#2172): Glob with lintr itself.
75-
exclusions = c(local({
76-
exclusion_for_dir <- function(dir, exclusions) {
77-
files = file.path("..", list.files(dir, pattern = "\\.(R|Rmd|Rraw)$", full.names=TRUE))
78-
stats::setNames(rep(list(exclusions), length(files)), files)
79-
}
80-
c(
81-
exclusion_for_dir("tests", list(
82-
quotes_linter = Inf,
83-
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
84-
implicit_integer_linter = Inf,
85-
infix_spaces_linter = Inf,
86-
undesirable_function_linter = Inf
87-
)),
88-
exclusion_for_dir(c("vignettes", "vignettes/fr", "vignettes/ru"), list(
89-
# assignment_linter = Inf,
90-
implicit_integer_linter = Inf,
91-
quotes_linter = Inf,
92-
sample_int_linter = Inf
93-
# strings_as_factors_linter = Inf
94-
# system_time_linter = Inf
95-
)),
96-
exclusion_for_dir("inst/tests", list(
97-
library_call_linter = Inf,
98-
numeric_leading_zero_linter = Inf,
99-
undesirable_operator_linter = Inf, # For ':::', possibly we could be more careful to only exclude ':::'.
100-
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
101-
comparison_negation_linter = Inf,
102-
condition_call_linter = Inf,
103-
duplicate_argument_linter = Inf,
104-
equals_na_linter = Inf,
105-
missing_argument_linter = Inf,
106-
paste_linter = Inf,
107-
rep_len_linter = Inf,
108-
sample_int_linter = Inf,
109-
seq_linter = Inf,
110-
unnecessary_lambda_linter = Inf
111-
))
74+
# NB: paths are relative to this file. See r-lib/lintr#2780
75+
exclusions = list(
76+
`../tests` = list(
77+
quotes_linter = Inf,
78+
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
79+
implicit_integer_linter = Inf,
80+
infix_spaces_linter = Inf,
81+
undesirable_function_linter = Inf
82+
),
83+
`../vignettes*` = list(
84+
# assignment_linter = Inf,
85+
implicit_integer_linter = Inf,
86+
quotes_linter = Inf,
87+
sample_int_linter = Inf
88+
# strings_as_factors_linter = Inf
89+
# system_time_linter = Inf
90+
),
91+
`../inst/tests` = list(
92+
library_call_linter = Inf,
93+
numeric_leading_zero_linter = Inf,
94+
undesirable_operator_linter = Inf, # For ':::', possibly we could be more careful to only exclude ':::'.
95+
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
96+
comparison_negation_linter = Inf,
97+
condition_call_linter = Inf,
98+
duplicate_argument_linter = Inf,
99+
equals_na_linter = Inf,
100+
missing_argument_linter = Inf,
101+
paste_linter = Inf,
102+
rep_len_linter = Inf,
103+
sample_int_linter = Inf,
104+
seq_linter = Inf,
105+
unnecessary_lambda_linter = Inf
106+
),
107+
`../inst/tests/froll.Rraw` = list(
108+
dt_test_literal_linter = Inf # TODO(michaelchirico): Fix these once #5898, #5692, #5682, #5576, #5575, #5441 are merged.
112109
)
113-
}),
114-
list(`../inst/tests/froll.Rraw` = list(dt_test_literal_linter = Inf)) # TODO(michaelchirico): Fix these once #5898, #5692, #5682, #5576, #5575, #5441 are merged.
115110
)

0 commit comments

Comments
 (0)