Skip to content

object_usage_linter() misses functions defined with \(x) lambda #1933

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

Closed
MichaelChirico opened this issue Mar 25, 2023 · 0 comments · Fixed by #1934
Closed

object_usage_linter() misses functions defined with \(x) lambda #1933

MichaelChirico opened this issue Mar 25, 2023 · 0 comments · Fixed by #1934
Labels
false-negative code that should lint, but doesn't object linters 🏀

Comments

@MichaelChirico
Copy link
Collaborator

lintr::lint("f <- \\() x\n", lintr::object_usage_linter())
lintr::lint("f <- function() x\n", lintr::object_usage_linter())
# Warning message:
# In parse_check_usage(fun, known_used_symbols = known_used_symbols,  :
#   Possible bug in lintr: Couldn't parse usage message ‘<anonymous>: no visible binding for global variable 'x'
# ’. Ignoring 1 usage warnings.

(the warning in the second case is #1917)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-negative code that should lint, but doesn't object linters 🏀
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant