-
Notifications
You must be signed in to change notification settings - Fork 186
Remove false negatives with seq()
in seq_linter()
#1468
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
Conversation
seq_linter()
seq_linter()
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@MichaelChirico I think I've addressed all of your comments. So this should be all set. |
}) | ||
|
||
test_that("finds seq(...) expressions", { | ||
linter <- seq_linter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a test for seq(dim(x)[1]) which is how dim would usually be used? it's pretty rare (never seen it before myself), so if the current approach doesn't work, just file a follow-up issue.
but if the current xpath is good enough just add tests to prevent regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the current xpath is good enough just add tests to prevent regression
The current approach does work. Added a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait. This should actually produce a lint:
seq(dim(data.frame())[1])
#> [1] 1 0
Created on 2022-07-26 by the reprex package (v2.0.1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right... don't worry about it though. just please file a follow-up issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and plz revert the incorrect test :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay if I add the correct test but comment it out for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue to track this: #1474
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that's fine, though we'll have to be wary of comment_linter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see :)
seq_linter()
seq()
in seq_linter()
Closes #1467
TODO
Example
Created on 2022-07-24 by the reprex package (v2.0.1)