Skip to content

object_name_linter can't detect S3 methods for the %/% operator? #2851

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

Open
eitsupi opened this issue Apr 23, 2025 · 0 comments
Open

object_name_linter can't detect S3 methods for the %/% operator? #2851

eitsupi opened this issue Apr 23, 2025 · 0 comments

Comments

@eitsupi
Copy link
Contributor

eitsupi commented Apr 23, 2025

library(lintr)

lint(
  text = r"(
#' @export
`%%.foo` <- function(x, y) TRUE

#' @export
`%/%.foo` <- function(x, y) TRUE

#' @export
`-.foo` <- function(x, y) TRUE
)",
  linters = object_name_linter()
)
#> <text>:6:1: style: [object_name_linter] Variable and function name style should match snake_case or symbols.
#> `%/%.foo` <- function(x, y) TRUE
#> ^~~~~~~~~

Created on 2025-04-23 with reprex v2.1.1

For some reason only %/%.foo seems to be complained by the object_name_linter in the above example.

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

No branches or pull requests

1 participant