Skip to content

Commit

Permalink
implicit integers feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Dec 6, 2023
1 parent b91f65f commit aaa7268
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/implicit_integer_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ implicit_integer_linter <- function(allow_colon = FALSE) {
xml_nodes_to_lints(
numbers[is_implicit_integer(xml_text(numbers))],
source_expression = source_expression,
lint_message =
"Avoid implicit integers. Make the type explicit by using the form 1L for integers or 1.0 for doubles.",
lint_message = "Avoid implicit integers. Use e.g. 1L for integers or 1.0 for doubles.",
type = "style",
column_number_xpath = "number(./@col2 + 1)", # mark at end
range_end_xpath = "number(./@col2 + 1)" # end after number for easy fixing (enter "L" or ".0")
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-implicit_integer_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ local({

test_that("linter returns the correct linting", {
linter <- implicit_integer_linter()
lint_msg <-
rex::rex("Avoid implicit integers. Make the type explicit by using the form 1L for integers or 1.0 for doubles.")
lint_msg <- rex::rex("Avoid implicit integers. Use e.g. 1L for integers or 1.0 for doubles.")

expect_lint("x <<- 1L", NULL, linter)
expect_lint("1.0/-Inf -> y", NULL, linter)
Expand Down

0 comments on commit aaa7268

Please sign in to comment.