Skip to content

Commit

Permalink
note an alternative implementation we eschew
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed May 4, 2024
1 parent c24c1d4 commit dc2d6ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .ci/linters/dt_lengths_linter.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# This is lintr::lengths_linter(), but including 'vapply_1i()' which is more common internally in data.table
# alternatively, this could be defined with something like
# dt_lengths_linter <- lintr::lengths_linter()
# local({ # to remove 'e'
# e <- environment(dt_lengths_linter)
# e$function_names <- c(evalq(function_names, e), "vapply_1i")
# })
# but that feels more fragile than this.
dt_lengths_linter <- lintr::make_linter_from_function_xpath(
function_names = c("sapply", "vapply", "vapply_1i", "map_int", "map_dbl"),
xpath = "parent::expr/parent::expr[expr/SYMBOL[text() = 'length']]",
Expand Down

0 comments on commit dc2d6ed

Please sign in to comment.