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

Deprecation message for "with_defaults" is misleading #1438

Closed
russHyde opened this issue Jun 28, 2022 · 0 comments · Fixed by #1448
Closed

Deprecation message for "with_defaults" is misleading #1438

russHyde opened this issue Jun 28, 2022 · 0 comments · Fixed by #1448

Comments

@russHyde
Copy link
Collaborator

The deprecation message for with_defaults urges users to use linters_with_defaults. For most uses, I imagine that is the correct replacement. But the deprecation causes some confusion in settings where an old-style config looked like:

linters: with_defaults(
    assignment_linter = NULL,
    undesirable_operator_linter(
      with_defaults(
        "<-" = "Use =, not <-, for assignment.",
        default = default_undesirable_operators
      )
    )
  )

Here, when lintr::lint_package() is called, two deprecation messages are printed to the console. Both suggest using linters_with_defaults in place of with_defaults. But when defining the undesirable-op list, linters_with_defaults is not the appropriate replacement for with_defaults. Here, the recommendation should be modify_defaults.

Could we modify the deprecation warning to print

Warning message:
Function with_defaults was deprecated in lintr version 3.0.0. Use linters_with_defaults or modify_defaults instead.
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