Skip to content

Ensure setters are handled in object_usage_linter() test suite #2451

@MichaelChirico

Description

@MichaelChirico
          I don't know what this TODO is talking about, exactly. I tried these snippets and they lint as expected:
lint(linters = object_usage_linter(), "
foo <- function() {
  not_exists(x) <- 2
  not_exists(x)
}")
# <text>:3:3: warning: [object_usage_linter] no visible global function definition for 'not_exists<-'
#   not_exists(x) <- 2
#   ^~~~~~~~~~
# <text>:4:3: warning: [object_usage_linter] no visible global function definition for 'not_exists'
#   not_exists(x)
#   ^~~~~~~~~~
lint(linters = object_usage_linter(), "
not_exists <- function(x) x
foo <- function() {
  not_exists(x) <- 2
  not_exists(x)
}")
# <text>:4:3: warning: [object_usage_linter] no visible global function definition for 'not_exists<-'
#   not_exists(x) <- 2
#   ^~~~~~~~~~

So deleting and waiting for something to be reported in tracker if there's actually something there.

Originally posted by @MichaelChirico in #2439 (comment)


The above should be added as regression tests, if not there already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions