Skip to content

any_duplicated_linter should land on the whole '==' expression #2860

@MichaelChirico

Description

@MichaelChirico

Not directly caused by this PR but shouldn't this XPath land on the parent expr?

lintr::lint(
    text = "x[, length(unique(col)) == .N]",
    linters = lintr::any_duplicated_linter()
)
#> <text>:1:5: warning: [any_duplicated_linter] anyDuplicated(x) == 0L is better than length(unique(x)) == .N
#> x[, length(unique(col)) == .N]
#>     ^~~~~~~~~~~~~~~~~~~

Created on 2025-06-02 with reprex v2.1.1

Originally posted by @Bisaloo in #2795 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions