Open MichaelChirico opened 2 years ago
Here's another thing straight out of the style guide that we don't lint for, that styler fixes:
styler
styler::style_text(" foo <- function(x) { if (x > 1) return(x) return(x - 1) } ") # foo <- function(x) { # if (x > 1) { # return(x) # } # return(x - 1) # }
https://style.tidyverse.org/syntax.html#inline-statements
Function calls that affect control flow (like return(), stop() or continue) should always go in their own {} block:
return()
stop()
continue
{}
I guess this should be a new parameter in return_linter()?
return_linter()
This seems to better suit brace_linter() since the advice is regarding placement of braces.
brace_linter()
Here's another thing straight out of the style guide that we don't lint for, that
styler
fixes:https://style.tidyverse.org/syntax.html#inline-statements