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

undesirable_operator_linter could optionally lint in functional form #1910

Closed
MichaelChirico opened this issue Feb 13, 2023 · 0 comments · Fixed by #2761
Closed

undesirable_operator_linter could optionally lint in functional form #1910

MichaelChirico opened this issue Feb 13, 2023 · 0 comments · Fixed by #2761
Labels
feature a feature request or enhancement
Milestone

Comments

@MichaelChirico
Copy link
Collaborator

MichaelChirico commented Feb 13, 2023

Consider:

lintr::lint("`%%`(x, y)\n", lintr::undesirable_operator_linter(c("%%" = NA)))

This doesn't throw a lint because %% is a call, not an operator. But it seems reasonable to expect this code to lint (perhaps optionally), e.g. if I'm a package developer trying to deprecate my old %old-grapes% in favor of %new-grapes%. Then any usage of the old function should be pointed out if I'm offering a tool for my downstreams to self-diagnose their exposure.

Of course, we could use undesirable_function_linter(c("%%" = NA)) (well, actually it seems there's a bug there), but users needn't think of that.

@MichaelChirico MichaelChirico added the feature a feature request or enhancement label Feb 13, 2023
@MichaelChirico MichaelChirico changed the title undesirable_operator_linter could optionally lint in infix form undesirable_operator_linter could optionally lint in functional form Oct 12, 2023
@MichaelChirico MichaelChirico added this to the 3.1.2 milestone Oct 12, 2023
@MichaelChirico MichaelChirico modified the milestones: 3.2.0, 3.3.0 Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant