Skip to content

Conversation

@MichaelChirico
Copy link
Collaborator

Another follow-up to #2603

@IndrajeetPatil
Copy link
Collaborator

Where relevant, maybe we can also get rid of them from tests?

image

@MichaelChirico
Copy link
Collaborator Author

Where relevant, maybe we can also get rid of them from tests?

image

no, all of those are in functions that retained a TRUE default e.g. expand.grid()

@IndrajeetPatil
Copy link
Collaborator

Even this one?

    exp <- data.frame(
    filename = rep("dummy.R", 2L),
    line_number = c(1L, 2L),
    column_number = c(1L, 6L),
    type = c("style", "error"),
    message = c("", "Under no circumstances is the use of foobar allowed."),
    line = c("", "a <- 1"),
    linter = c(NA_character_, NA_character_), # These are assigned in lint() now.
    stringsAsFactors = FALSE
  )

@MichaelChirico
Copy link
Collaborator Author

must have missed one :)

@MichaelChirico
Copy link
Collaborator Author

OK, ran an ad hoc linter this time to make sure everything's covered:

l <- make_linter_from_xpath(lint_message = "", "
  //SYMBOL_SUB[text() = 'stringsAsFactors']
    /parent::expr[not(
      expr/SYMBOL_FUNCTION_CALL[text() = 'expand.grid']
      or ./expr/expr/SYMBOL_FUNCTION_CALL[text() = 'table']
    )]
  ")
lint_package(linters = l())

Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@IndrajeetPatil IndrajeetPatil merged commit 2a8a857 into main Jun 15, 2024
@IndrajeetPatil IndrajeetPatil deleted the saf branch June 15, 2024 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants