Skip to content

Conversation

@MichaelChirico
Copy link
Collaborator

Closes #2088

In writing this I had three follow-up questions

  1. Should we customize the lint message for %in%/==/!= (yes)
  2. Should we lint x %in% c(NA, y) to encourage is.na(x) | x %in% y (I think no)
  3. Should we lint NA %in% x (should be anyNA(x); I am less sure, maybe it could go under any_is_na_linter()?)

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Merging #2112 (7bfc14f) into main (99fdd85) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 7bfc14f differs from pull request most recent head e252ee2. Consider uploading reports for the commit e252ee2 to get more accurate results

@@           Coverage Diff           @@
##             main    #2112   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         120      120           
  Lines        5240     5242    +2     
=======================================
+ Hits         5222     5224    +2     
  Misses         18       18           
Files Changed Coverage Δ
R/equals_na_linter.R 100.00% <100.00%> (ø)

📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AshesITR AshesITR left a comment

Choose a reason for hiding this comment

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

Re 3.: I Agree it should be linted in the any_is_na_linter()

@AshesITR
Copy link
Collaborator

AshesITR commented Sep 7, 2023

Also should test that NA %in% x doesn't lint here.

@MichaelChirico
Copy link
Collaborator Author

Follow-ups:

#2113
#2114

@MichaelChirico
Copy link
Collaborator Author

Also should test that NA %in% x doesn't lint here.

Good call -- the logic was broken (==/!= throw lint for NA on LHS or LHS of the operator, not so for %in%). Done now

@AshesITR AshesITR merged commit 68b82ce into main Sep 7, 2023
@AshesITR AshesITR deleted the eq-na-in branch September 7, 2023 19:28
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.

throw equals_na_linter() for x %in% NA

4 participants