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

Convert all TODO(user) to TODO(issue) #2494

Merged
merged 9 commits into from
Jan 9, 2024
Merged

Convert all TODO(user) to TODO(issue) #2494

merged 9 commits into from
Jan 9, 2024

Conversation

MichaelChirico
Copy link
Collaborator

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).

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue reference lost

Copy link
Collaborator Author

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-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (11eae86) 98.55% compared to head (5241c83) 98.55%.

❗ Current head 5241c83 differs from pull request most recent head 8036e1b. Consider uploading reports for the commit 8036e1b to get more accurate results

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.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Collaborator Author

@MichaelChirico MichaelChirico Dec 19, 2023

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.

@AshesITR
Copy link
Collaborator

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")
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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?
Copy link
Collaborator Author

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?
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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).
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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?
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is #1835

@MichaelChirico
Copy link
Collaborator Author

To help with reviewing, please comment the issue number in the PR where you removed the comment. Thanks for the house keeping!

SG, done.

Copy link
Collaborator

@AshesITR AshesITR left a 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 :)

@MichaelChirico MichaelChirico merged commit 15c556f into main Jan 9, 2024
19 of 20 checks passed
@MichaelChirico MichaelChirico deleted the todo-gh branch January 9, 2024 00:12
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.

All TODO should refer to GitHub issues
3 participants