Skip to content

Assume stringsAsFactors=FALSE #2605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 15, 2024
Merged

Assume stringsAsFactors=FALSE #2605

merged 5 commits into from
Jun 15, 2024

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
18 checks passed
@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.

2 participants