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

Check relevance of false positive in yoda_test_linter #979

Closed
MichaelChirico opened this issue Mar 22, 2022 · 2 comments
Closed

Check relevance of false positive in yoda_test_linter #979

MichaelChirico opened this issue Mar 22, 2022 · 2 comments
Milestone

Comments

@MichaelChirico
Copy link
Collaborator

This is a known false positive in yoda_test_linter():

expect_equal(1, 1)

This should be linted (it's a placeholder that shouldn't really be checked in "to prod"), but currently the message is confusing.

We should check the practical relevance of this concern, though, before investing in a workaround.

@MichaelChirico
Copy link
Collaborator Author

Found usages like this in 3 (out of 1005 sampled) packages:

https://github.com/DanChaltiel/crosstable/blob/bb50afa7abb52a9195836f06fc067827a9c1affa/tests/testthat/todo_test-1-crosstable-v2.R#L396

https://github.com/SoerenPannier/emdi/blob/ddbb55e75345170193c5f629cb455b7c61f4eade/tests/testthat/test_fh_std_spatial_robust.R#L320

https://github.com/jonocarroll/ggghost/blob/888ca70248bc501d3af4ca318e61a46d9c159286/tests/testthat/test_Ops.R#L10

The ggghost usages look like false positives -- the test is explicitly ensuring an overloaded + method works as expected for arithmetic input. That seems like a prime candidate for # nolint to me, so I am fine to ignore it.

As to the others, yes, let's invest in customizing the message to be better for this case.

@MichaelChirico
Copy link
Collaborator Author

closed by #1065

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

No branches or pull requests

1 participant