Skip to content

Commit

Permalink
Mention saving the output of order() in sort_linter() message (#2407)
Browse files Browse the repository at this point in the history
* mention saving the output of order()

* new wording
  • Loading branch information
MichaelChirico authored Dec 15, 2023
1 parent 2428646 commit 3b933a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/sort_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ sort_linter <- function() {
order_lints <- xml_nodes_to_lints(
order_expr,
source_expression = source_expression,
lint_message = paste0(new_call, " is better than ", orig_call, "."),
lint_message = paste0(
new_call, " is better than ", orig_call, ". ",
"Note that it's always preferable to save the output of order() for the same variable ",
"as a local variable than to re-compute it."
),
type = "warning"
)

Expand Down

0 comments on commit 3b933a9

Please sign in to comment.