Skip to content

length_test_linter() for length(x == 0)#2124

Merged
AshesITR merged 8 commits intomainfrom
length_test_linter
Sep 10, 2023
Merged

length_test_linter() for length(x == 0)#2124
AshesITR merged 8 commits intomainfrom
length_test_linter

Conversation

@MichaelChirico
Copy link
Copy Markdown
Collaborator

Closes #1991.

length_equals_linter() generalized to length_test_linter() to incorporate other cases where length() is applied to a logical vector, e.g. length(x > 0).

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 8, 2023

Codecov Report

Merging #2124 (5d6502e) into main (02f7db8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 5d6502e differs from pull request most recent head ba6ef99. Consider uploading reports for the commit ba6ef99 to get more accurate results

@@           Coverage Diff           @@
##             main    #2124   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         111      112    +1     
  Lines        5097     5116   +19     
=======================================
+ Hits         5079     5098   +19     
  Misses         18       18           
Files Changed Coverage Δ
R/length_test_linter.R 100.00% <100.00%> (ø)

Comment thread tests/testthat/test-length_test_linter.R Outdated
Comment thread R/length_test_linter.R Outdated
Comment thread tests/testthat/test-length_test_linter.R
@AshesITR AshesITR merged commit 9bd015d into main Sep 10, 2023
@AshesITR AshesITR deleted the length_test_linter branch September 10, 2023 08:53
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.

Linter for length(x == y) where almost certainly length(which(x == y)) or length(x) == y was intended

4 participants