Skip to content

Commit

Permalink
Emphasize S3-S4 difference in recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Nov 22, 2024
1 parent 9d58027 commit 15cd3de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/class_equals_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ class_equals_linter <- function() {
bad_expr <- xml_find_all(xml_calls, xpath)

operator <- xml_find_chr(bad_expr, "string(*[2])")
lint_message <- sprintf(
"Use inherits(x, 'class-name'), is.<class> or is(x, 'class') instead of comparing class(x) with %s.",
operator
lint_message <- paste0(
"Use inherits(x, 'class-name'), is.<class> for S3 classes, ",
"or is(x, 'S4Class') for S4 classes, ",
"instead of comparing class(x) with ", operator, "."
)
xml_nodes_to_lints(
bad_expr,
Expand Down

0 comments on commit 15cd3de

Please sign in to comment.