Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get code for custom linters working #6099

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading