Skip to content

flagging commented arguments of a function being tested #386

@IndrajeetPatil

Description

@IndrajeetPatil

If a line of code is commented, then lintr produces a lint of type

Commented code should be removed.

Example of this would be the following line of code-

# testthat::expect_equal(broom_df1$p.value, tidy_df1$p.value, tolerance = 0.001)

Does it also make sense to produce a lint of type

Commented arguments should be removed.

For example, here the second argument is commented out-

 d <- t.test(
        x = dplyr::starwars$height,
       # var.equal = TRUE,
        conf.level = .99,
        mu = 175
      )

testthat::expect_equal(d$statistic[[1]], -0.1661693, tolerance = 0.001)

This can typically happen when interactively writing tests and it will be nice for lintr to highlight such vestiges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementhelp wanted ❤️we'd love your help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions