Repository navigation
Remove false negatives with seq() in seq_linter() - #1468
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.
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.
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.
Oh, wait. This should actually produce a lint:
seq(dim(data.frame())[1])
#> [1] 1 0Created on 2022-07-26 by the reprex package (v2.0.1)
There was a problem hiding this comment.
right... don't worry about it though. just please file a follow-up issue
There was a problem hiding this comment.
and plz revert the incorrect test :)
There was a problem hiding this comment.
Is it okay if I add the correct test but comment it out for now?
There was a problem hiding this comment.
yep that's fine, though we'll have to be wary of comment_linter
seq_linter()seq() in seq_linter()
Closes #1467
TODO
Example
Created on 2022-07-24 by the reprex package (v2.0.1)