Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning from examples on oldrel #1392

Closed
MichaelChirico opened this issue Jun 14, 2022 · 1 comment · Fixed by #1393
Closed

Warning from examples on oldrel #1392

MichaelChirico opened this issue Jun 14, 2022 · 1 comment · Fixed by #1393

Comments

@MichaelChirico
Copy link
Collaborator

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.

@MichaelChirico
Copy link
Collaborator Author

Actually, it looks like this recent change is why it's not showing up in r-devel/current release. But still don't know why it's not showing up in GHA oldrel:

r-devel/r-svn@5490269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant