Skip to content

Commit

Permalink
get code for custom linters working
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed May 4, 2024
1 parent 8fdd408 commit b08788f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .ci/.lintr.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
for (f in list.files('ci/linters', full.names=TRUE)) source(f)
dt_linters = new.env()
for (f in list.files('.ci/linters', full.names=TRUE)) sys.source(f, dt_linters)
rm(f)

linters = all_linters(
# NB: Could do this inside the linter definition, this separation makes those files more standardized
dt_linters <- eapply(dt_linters, function(linter_factory) linter_factory())

linters = c(dt_linters, all_linters(
packages = "lintr", # TODO(lintr->3.2.0): Remove this.
# eq_assignment_linter(),
brace_linter(allow_single_line = TRUE),
Expand Down Expand Up @@ -81,7 +85,9 @@ linters = all_linters(
unnecessary_nesting_linter = NULL,
unreachable_code_linter = NULL,
unused_import_linter = NULL
)
))
rm(dt_linters)

# TODO(lintr#2172): Glob with lintr itself.
exclusions = local({
exclusion_for_dir <- function(dir, exclusions) {
Expand Down

0 comments on commit b08788f

Please sign in to comment.