Skip to content

Commit

Permalink
customize lengths_linter for data.table usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Apr 23, 2024
1 parent 01ef69c commit fb230c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .ci/linters/dt_lengths_linter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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']]",
lint_message = "Use lengths() to find the length of each element in a list."
)

0 comments on commit fb230c6

Please sign in to comment.