Skip to content

Commit 3a80920

Browse files
Use new globbing support from upstream in lintr config (#6835)
* remove more explicit returns * use new globbing support from upstream * comment not needed
1 parent 6a8634e commit 3a80920

File tree

1 file changed

+34
-40
lines changed

1 file changed

+34
-40
lines changed

.ci/.lintr.R

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -71,45 +71,39 @@ 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+
exclusions = list(
75+
`../tests` = list(
76+
quotes_linter = Inf,
77+
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
78+
implicit_integer_linter = Inf,
79+
infix_spaces_linter = Inf,
80+
undesirable_function_linter = Inf
81+
),
82+
`../vignettes*` = list(
83+
# assignment_linter = Inf,
84+
implicit_integer_linter = Inf,
85+
quotes_linter = Inf,
86+
sample_int_linter = Inf
87+
# strings_as_factors_linter = Inf
88+
# system_time_linter = Inf
89+
),
90+
`../inst/tests` = list(
91+
library_call_linter = Inf,
92+
numeric_leading_zero_linter = Inf,
93+
undesirable_operator_linter = Inf, # For ':::', possibly we could be more careful to only exclude ':::'.
94+
# TODO(michaelchirico): Enforce these and re-activate them one-by-one.
95+
comparison_negation_linter = Inf,
96+
condition_call_linter = Inf,
97+
duplicate_argument_linter = Inf,
98+
equals_na_linter = Inf,
99+
missing_argument_linter = Inf,
100+
paste_linter = Inf,
101+
rep_len_linter = Inf,
102+
sample_int_linter = Inf,
103+
seq_linter = Inf,
104+
unnecessary_lambda_linter = Inf
105+
),
106+
`../inst/tests/froll.Rraw` = list(
107+
dt_test_literal_linter = Inf # TODO(michaelchirico): Fix these once #5898, #5692, #5682, #5576, #5575, #5441 are merged.
112108
)
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.
115109
)

0 commit comments

Comments
 (0)