-
Notifications
You must be signed in to change notification settings - Fork 186
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
Convert all TODO(user) to TODO(issue) #2494
Conversation
@@ -46,11 +46,6 @@ | |||
#' @evalRd rd_tags("keyword_quote_linter") | |||
#' @seealso [linters] for a complete list of linters available in lintr. | |||
#' @export | |||
# TODO(michaelchirico): offer a stricter version of this that |
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.
Issue reference lost
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.
This is #2471. I took a bit of a judgment call in some cases on totally removing the TODO from the sources, here's one of them. I think it's a bit odd to anchor this TODO to the function overall, interrupting the roxygen2 mark-up, so I removed it.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2494 +/- ##
=======================================
Coverage 98.55% 98.55%
=======================================
Files 126 126
Lines 5762 5762
=======================================
Hits 5679 5679
Misses 83 83 ☔ View full report in Codecov by Sentry. |
@@ -21,8 +21,6 @@ | |||
#' @seealso [linters] for a complete list of linters available in lintr. | |||
#' @export | |||
list_comparison_linter <- function() { | |||
# TODO(michaelchirico): extend to cases where using simplify=FALSE implies a |
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.
ditto
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.
Here I don't think the TODO anchors to this expression in particular, so I removed it. The issue is #2472.
@@ -49,10 +49,6 @@ test_that("any_duplicated_linter catches length(unique()) equivalencies too", { | |||
expect_lint("length(unique(x)) != length(x)", lint_msg_x, linter) | |||
expect_lint("length(unique(x)) < length(x)", lint_msg_x, linter) | |||
expect_lint("length(x) > length(unique(x))", lint_msg_x, linter) | |||
|
|||
# TODO(michaelchirico): try and match data.table- and dplyr-specific versions of |
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.
ditto
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.
I removed all of the TODO from the tests, I don't think they should live there.
For the record this is #2481.
To help with reviewing, please comment the issue number in the PR where you removed the comment. Thanks for the house keeping! |
@@ -34,11 +34,9 @@ | |||
#' @seealso [linters] for a complete list of linters available in lintr. | |||
#' @export | |||
is_numeric_linter <- function() { | |||
# TODO(michaelchirico): this should also cover is.double(x) || is.integer(x) | |||
# TODO(#1636): is.numeric(x) || is.integer(x) || is.factor(x) is also redundant | |||
# TODO(michaelchirico): consdier capturing any(class(x) == "numeric/integer") |
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.
these two are combined in #2470
@@ -60,14 +60,6 @@ test_that("expect_s3_class_linter blocks simple disallowed usages", { | |||
rex::rex("expect_s3_class(x, k) is better than expect_true(is.<k>(x))"), | |||
linter | |||
) | |||
|
|||
# TODO(michaelchirico): consider more carefully which sorts of class(x) %in% . and |
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.
@@ -270,19 +270,6 @@ test_that("fixed replacement is correct with UTF-8", { | |||
) | |||
}) | |||
|
|||
# TODO(michaelchirico): one difference for stringr functions vs. base is that |
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.
This is done already, I think on the last release when we did pipe-awareness consistency.
# > str %>% str_detect("x") | ||
# is a false negative. thankfully there appear to be few false positives here | ||
|
||
# TODO(michaelchirico): we could in principle build in logic to detect whether |
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.
@@ -83,5 +83,3 @@ test_that("exceptions= argument works", { | |||
|
|||
expect_lint("if (!foo(x)) y else z", NULL, if_not_else_linter(exceptions = "foo")) | |||
}) | |||
|
|||
# TODO(michaelchirico): should if (A != B) be considered as well? |
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.
@@ -81,6 +81,3 @@ test_that("lints vectorize", { | |||
ifelse_censor_linter() | |||
) | |||
}) | |||
|
|||
# TODO(michaelchirico): how easy would it be to strip parens when considering lint? |
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.
@@ -94,18 +94,12 @@ test_that("it handles tex", { | |||
file = test_path("knitr_formats", "test.Rtex"), | |||
checks = list( | |||
list(regexes[["indent"]], line_number = 11L), | |||
# TODO(AshesITR): |
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.
Both are #1043
@@ -17,9 +17,6 @@ test_that("nzchar_linter skips as appropriate for other nchar args", { | |||
# type="bytes" should be >= the value for the default (type="chars") | |||
expect_lint("nchar(x, type='width') == 0L", NULL, linter) | |||
|
|||
# TODO(michaelchirico): check compatibility of nchar(., allowNA=TRUE). |
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.
@@ -21,9 +21,7 @@ test_that("one_call_pipe_linter blocks simple disallowed usages", { | |||
# new lines don't matter | |||
expect_lint("x %>%\n foo()", lint_msg, linter) | |||
|
|||
# catch the "inner" pipe chain, not the "outer" one |
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.
@@ -167,8 +167,6 @@ test_that("unnecessary_lambda_linter doesn't apply to keyword args", { | |||
test_that("purrr-style anonymous functions are also caught", { | |||
linter <- unnecessary_lambda_linter() | |||
|
|||
# TODO(michaelchirico): this is just purrr::flatten(x). We should write another |
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.
@@ -27,9 +27,6 @@ test_that("unnecessary_nesting_linter skips allowed usages", { | |||
) | |||
}) | |||
|
|||
# TODO(michaelchirico): consider if there's a nice easy pattern to enforce for |
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.
@@ -720,30 +720,3 @@ test_that("allow_comment_regex= obeys covr's custom exclusion when set", { | |||
linter_covr | |||
) | |||
}) | |||
|
|||
# nolint start: commented_code_linter. | |||
# TODO(michaelchirico): extend to work on switch() statements |
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.
# }) | ||
# nolint end: commented_code_linter. | ||
|
||
# TODO(michaelchirico): This could also apply to cases without |
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.
@@ -61,15 +61,3 @@ test_that("lints vectorize", { | |||
yoda_test_linter() | |||
) | |||
}) | |||
|
|||
# TODO(michaelchirico): Should this be extended to RUnit tests? It seems yes, |
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.
Dropped this
# but the argument names in RUnit (inherited from base all.equal()) are a bit | ||
# confusing, e.g. `checkEqual(target=, current=)`. From the name, one might | ||
# reasonably conclude 'expected' comes first, and 'actual' comes second. | ||
# TODO(michaelchirico): What sorts of combinations of literals can be included? |
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.
# e.g. expect_equal(c(1, 2), x) is a yoda test; is expect_equal(c(x, 1), y)? | ||
# clearly it's not true for general f() besides c(). What about other | ||
# constructors of literals? data.frame(), data.table(), tibble(), ...? | ||
# TODO(michaelchirico): The logic could also be extended to "tests" inside regular |
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.
This is #1835
SG, done. |
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.
Thanks for the cleanup and your patience with this review :)
Closes #2450
Issues #2464 through #2493 are newly-formalized pending tasks spurred by this PR.
Some TODO were simply dropped (either I deemed them obsolete, or they were already fixed; I also dropped TODO in tests as not being the right place for them to live on as comments).