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

Issue #809 - Replace is.logical by isTRUE #815

Merged
merged 3 commits into from
May 19, 2024
Merged

Issue #809 - Replace is.logical by isTRUE #815

merged 3 commits into from
May 19, 2024

Conversation

nikosbosse
Copy link
Contributor

Description

This PR closes #809.

Doe what it says on the tin. Purpose is improving robustness and code clarity.

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title as follows: issue-number: PR title
  • I have tested my changes locally.
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required.
  • I have built the package locally and run rebuilt docs using roxygen2.
  • My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able.

Copy link

codecov bot commented May 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.54%. Comparing base (fbfbe56) to head (e62a20a).

Current head e62a20a differs from pull request most recent head 7f26674

Please upload reports for the commit 7f26674 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #815   +/-   ##
=======================================
  Coverage   95.54%   95.54%           
=======================================
  Files          21       21           
  Lines        1570     1573    +3     
=======================================
+ Hits         1500     1503    +3     
  Misses         70       70           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nikosbosse
Copy link
Contributor Author

nikosbosse commented May 19, 2024 via email

@jamesmbaazam
Copy link
Contributor

I think historically we didn't enforce r 3.5 or something like that. Or I was stupid:D

On Sun, 19 May 2024, 15:04 James Azam, @.> wrote: @.* commented on this pull request. ------------------------------ In R/check-input-helpers.R <#815 (comment)> : > - return(is.logical(check)) + return(isTRUE(check)) Mmhhh interesting! Why was is.logical() use here? it returns TRUE for both TRUE and FALSE whereas isTRUE will only returns TRUE for a value of TRUE. — Reply to this email directly, view it on GitHub <#815 (review)>, or unsubscribe <github.com/notifications/unsubscribe-auth/AJBYFLLMQFPSQP4I4AWLSQTZDCPOLAVCNFSM6AAAAABH6EUGM6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANRVGA3TKMRTGM> . You are receiving this because you authored the thread.Message ID: @.***>

I think it is unlikely to have caused any bugs unless in edge cases that I can't imagine atm, since "check" is either a string or TRUE. But the isTRUE() replace here is safer.

Copy link
Contributor

@jamesmbaazam jamesmbaazam left a comment

Choose a reason for hiding this comment

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

Jumping here to review this.

LGTM.

@nikosbosse
Copy link
Contributor Author

Lovely, thank you!

@nikosbosse nikosbosse merged commit 87adf45 into main May 19, 2024
@nikosbosse nikosbosse deleted the fix-logicals branch May 19, 2024 13:57
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.

Replace is.logical by isTRUE in the code
3 participants