Skip to content
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
28 changes: 18 additions & 10 deletions .lintr.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


undesirable_functions <-
lintr::default_undesirable_functions |>
undesirable_functions <-
lintr::default_undesirable_functions |>
lintr::modify_defaults(

# following https://github.com/r-lib/devtools/blob/2aa51ef/.lintr.R:
Expand All @@ -25,25 +25,26 @@
"\nSee:\n",
"<https://r-pkgs.org/code.html#sec-code-r-landscape> and\n",
"<https://r-pkgs.org/testing-design.html#sec-testing-design-self-contained>",
"\nfor more details"
"\nfor more details."
),

structure = NULL
# see https://github.com/r-lib/lintr/pull/2227 and
structure = NULL,
browser = NULL
# see https://github.com/r-lib/lintr/pull/2227 and
# rebuttal https://github.com/r-lib/lintr/pull/2227#issuecomment-1800302675

)

# define snake_case with uppercase acronyms allowed;
# see https://github.com/r-lib/lintr/issues/2844 for details:
withr::local_package("rex")
snake_case_ACRO = rex::rex(
snake_case_ACROs1 <- rex::rex(
start,
maybe("."),
some_of(lower, digit) %or% some_of(upper, digit),
list(some_of(upper), maybe("s"), zero_or_more(digit)) %or% list(some_of(lower), zero_or_more(digit)),

Check notice on line 44 in .lintr.R

View check run for this annotation

codefactor.io / CodeFactor

.lintr.R#L44

Lines should not be more than 80 characters. This line is 103 characters. (line_length_linter)
zero_or_more(
"_",
some_of(lower, digit) %or% some_of(upper, digit)
list(some_of(upper), maybe("s"), zero_or_more(digit)) %or% list(some_of(lower), zero_or_more(digit))

Check notice on line 47 in .lintr.R

View check run for this annotation

codefactor.io / CodeFactor

.lintr.R#L47

Lines should not be more than 80 characters. This line is 104 characters. (line_length_linter)
),
end
)
Expand All @@ -54,7 +55,7 @@
lintr::redundant_equals_linter(),
lintr::pipe_consistency_linter(pipe = "|>"),
lintr::object_name_linter(
regexes = c(snake_case_ACRO = snake_case_ACRO)
regexes = c(snake_case_ACROs1 = snake_case_ACROs1)
),
lintr::undesirable_function_linter(
fun = undesirable_functions,
Expand All @@ -64,12 +65,19 @@

# prevent warnings from lintr::read_settings:
rm(undesirable_functions)
rm(snake_case_ACRO)
rm(snake_case_ACROs1)
exclusions <- list(
`data-raw` = list(
pipe_consistency_linter = Inf
),
vignettes = list(
undesirable_function_linter = Inf
),
"inst/analyses" = list(
undesirable_function_linter = Inf
),
"tests/testthat.R" = list(
undesirable_function_linter = Inf
)

)
Loading