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

Lint implicit return assignments in function_return_linter() #1574

Open
IndrajeetPatil opened this issue Sep 30, 2022 · 2 comments
Open

Lint implicit return assignments in function_return_linter() #1574

IndrajeetPatil opened this issue Sep 30, 2022 · 2 comments
Labels
feature a feature request or enhancement

Comments

@IndrajeetPatil
Copy link
Collaborator

Follow-up on #1569

Extend function_return_linter() to also lint implicit return assignments like the following (cf. #1569 (comment)):

foo <- function() {
  x <- 4
}
y <- foo() 
y
#> [1] 4

library(lintr)

lint(
  text = "foo <- function() {
            x <- 4
          }",
  linters = function_return_linter()
)

Created on 2022-09-30 with reprex v2.0.2

@IndrajeetPatil IndrajeetPatil added the feature a feature request or enhancement label Sep 30, 2022
@MichaelChirico
Copy link
Collaborator

Should function_return_linter() be subsumed into return_linter()?

@IndrajeetPatil
Copy link
Collaborator Author

Yes, I think that's a good idea.

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

No branches or pull requests

2 participants