Skip to content
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

Turn off strings_as_factors_linter() #1217

Merged
merged 1 commit into from
Jun 15, 2024
Merged

Turn off strings_as_factors_linter() #1217

merged 1 commit into from
Jun 15, 2024

Conversation

IndrajeetPatil
Copy link
Collaborator

Since we rely on >= R 4.0 now.

Since we rely on >= R 4.0 now.
Copy link
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 434cbc5 is merged into main:

  • ✔️cache_applying: 158ms -> 160ms [-3.97%, +6.62%]
  • ✔️cache_recording: 513ms -> 512ms [-1.15%, +0.8%]
  • ✔️without_cache: 1.05s -> 1.05s [-0.73%, +1.63%]

Further explanation regarding interpretation and methodology can be found in the documentation.

@MichaelChirico
Copy link
Contributor

Confirming this is everything re-using the ad hoc linter in r-lib/lintr#2605:

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())

@@ -104,8 +104,7 @@ cache_info <- function(cache_name = NULL, format = "both") {
last_modified = suppressWarnings(max(file_info$mtime)),
created = file.info(path_cache)$ctime,
location = path_cache,
activated = cache_is_activated(cache_name),
stringsAsFactors = FALSE
Copy link
Contributor

Choose a reason for hiding this comment

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

IINM this is not WAI anyway?

styler:::styler_df(a = 1:10, b = 11:20, stringsAsFactors=FALSE)
    a  b stringsAsFactors
1   1 11            FALSE
2   2 12            FALSE
3   3 13            FALSE
4   4 14            FALSE
5   5 15            FALSE
6   6 16            FALSE
7   7 17            FALSE
8   8 18            FALSE
9   9 19            FALSE
10 10 20            FALSE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's true!

Copy link
Contributor

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

Feel free to merge, the part about styler_df() can be handled here or in another PR, up to you :)

@IndrajeetPatil IndrajeetPatil removed the request for review from lorenzwalthert June 15, 2024 06:33
@IndrajeetPatil IndrajeetPatil merged commit 7b5327c into main Jun 15, 2024
18 checks passed
@lorenzwalthert lorenzwalthert deleted the saf branch June 15, 2024 17:30
@lorenzwalthert lorenzwalthert restored the saf branch June 15, 2024 17:30
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