Skip to content

Warning from examples on oldrel #1392

@MichaelChirico

Description

@MichaelChirico

As of now, oldrel is throwing a warning:

https://www.r-project.org/nosvn/R.check/r-oldrel-macos-arm64/lintr-00check.html

checking examples ... [1s/1s] WARNING
Found the following significant warnings:

  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
  Warning: 'all.equal.default(<function>)' is deprecated.
Deprecated functions may be defunct as soon as of the next release of
R.
See ?Deprecated.

AFAICT, it's due to this line:

lintr/R/with.R

Line 76 in 5a0b54e

#' all.equal(linters_with_defaults(), linters_with_tags("default"))

which, because Linter() doesn't add "function" to the class winds up dispatching to all.equal.default() instead of all.equal.function().

I'm not sure why it's not showing up for GHA -- maybe there's some tweak in S3 dispatch that uses mode() (which is correctly "function") instead of class() for some versions?

Anyway, is there any reason not to change this line:

lintr/R/utils.R

Line 181 in 5a0b54e

structure(fun, class = "linter", name = name)

To set the Linter() output class to c("linter", "lintr_function", "function")? It seems like the better approach in general. It would also improve this line:

lintr/R/with.R

Lines 49 to 51 in 5a0b54e

if (is.function(x) && !inherits(x, "lintr_function")) {
class(x) <- c(prev_class, "lintr_function")
}

Where we apparently always add "lintr_function" to the class later, to do so up-front.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions