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

Typo when checking for truthy strings #437

Closed
Luke-Symes-Tsy opened this issue Feb 5, 2025 · 2 comments · Fixed by #438
Closed

Typo when checking for truthy strings #437

Luke-Symes-Tsy opened this issue Feb 5, 2025 · 2 comments · Fixed by #438
Labels
bug an unexpected problem or unintended behavior

Comments

@Luke-Symes-Tsy
Copy link
Contributor

I think there is a typo in this code:
https://github.com/r-lib/pkgdepends/blob/a89923be1648716d8e1c3e8c56421353d72e33ff/R/utils.R#L518C1-L523C2

The variable "thruthy" should be "truthy":

# Incorrect
thruthy_strings <- c("true", "t", "1", "on", "yes", "on")
# Correct
truthy_strings <- c("true", "t", "1", "on", "yes", "on")

So that the function works (which uses truthy_strings):

is_truthy <- function(x) {
  (is.logical(x) && length(x) >= 1 && !is.na(x[[1]]) && x[[1]]) ||
    (is.character(x) && length(x) >= 1 && tolower(x) %in% truthy_strings)
}

The current development version has an error:

Image

@gaborcsardi
Copy link
Member

Thanks! Would you like to submit a PR? (No pressure!)

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Feb 5, 2025
@Luke-Symes-Tsy
Copy link
Contributor Author

Yes I can put together a PR, looks like a good opportunity to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants