Skip to content

Commit

Permalink
drop "the equivalent"
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Dec 6, 2023
1 parent e0be1d9 commit fc612f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/is_numeric_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ is_numeric_linter <- function() {
class_expr,
source_expression = source_expression,
lint_message = paste(
'Use is.numeric(x) instead of the equivalent class(x) %in% c("integer", "numeric").',
'Use is.numeric(x) instead of class(x) %in% c("integer", "numeric").',
"Use is.double(x) to test for objects stored as 64-bit floating point."
),
type = "warning"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-is_numeric_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test_that("is_numeric_linter blocks disallowed usages involving ||", {

test_that("is_numeric_linter blocks disallowed usages involving %in%", {
linter <- is_numeric_linter()
lint_msg <- rex::rex('Use is.numeric(x) instead of the equivalent class(x) %in% c("integer", "numeric")')
lint_msg <- rex::rex('Use is.numeric(x) instead of class(x) %in% c("integer", "numeric")')

expect_lint("class(x) %in% c('integer', 'numeric')", lint_msg, linter)
expect_lint('class(x) %in% c("numeric", "integer")', lint_msg, linter)
Expand All @@ -58,7 +58,7 @@ test_that("raw strings are handled properly when testing in class", {
skip_if_not_r_version("4.0.0")

linter <- is_numeric_linter()
lint_msg <- rex::rex('Use is.numeric(x) instead of the equivalent class(x) %in% c("integer", "numeric")')
lint_msg <- rex::rex('Use is.numeric(x) instead of class(x) %in% c("integer", "numeric")')

expect_lint("class(x) %in% c(R'(numeric)', 'integer', 'factor')", NULL, linter)
expect_lint("class(x) %in% c('numeric', R'--(integer)--', y)", NULL, linter)
Expand Down

0 comments on commit fc612f8

Please sign in to comment.