Thanks to visit codestin.com
Credit goes to github.com

Skip to content

object_usage_linter doesn't catch assignments with = #1081

@MichaelChirico

Description

@MichaelChirico

Noticed while working on #1078.

Compare

  expect_lint(
    trim_some("
      fun <- function() {
        a <- 1
      }
    "),
    rex("local variable", anything, "assigned but may not be used"),
    linter
  )

and

  expect_lint(
    trim_some("
      fun = function() {
        a = 1
      }
    "),
    rex("local variable", anything, "assigned but may not be used"),
    linter
  )

The latter test fails on HEAD because the xpath for = assignments is wrong. Fix forthcoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions