From 15cd3de2cd60b9ddffbf078735aab4d56d69b65c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 22 Nov 2024 15:19:36 -0800 Subject: [PATCH] Emphasize S3-S4 difference in recommendation --- R/class_equals_linter.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/class_equals_linter.R b/R/class_equals_linter.R index 2dd24b83d..1f3483e9b 100644 --- a/R/class_equals_linter.R +++ b/R/class_equals_linter.R @@ -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. or is(x, 'class') instead of comparing class(x) with %s.", - operator + lint_message <- paste0( + "Use inherits(x, 'class-name'), is. for S3 classes, ", + "or is(x, 'S4Class') for S4 classes, ", + "instead of comparing class(x) with ", operator, "." ) xml_nodes_to_lints( bad_expr,