-
Notifications
You must be signed in to change notification settings - Fork 183
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
Skip switch() and other calls by default in unnecessary_nesting_linter() #2334
Comments
It looks like we want the following calls to be allowed by default:
I'm not really seeing a common through-line for why these & not other calls should be excepted. Any thoughts? If so that would help naming the parameter. Otherwise we can just call it |
Also try()
tryCatch()
withCallingHandlers()
quote()
expression()
bquote() I'd say those are functions that take an expression or expression block and compute on it in some way. |
|
Also, do we want unoverridable defaults like in |
Is I would not allow override for cases where it's incorrect. The other cases are IMO stylistic and can be put as overrideable defaults. |
I don't know of any other function that checks and complains. Functions that don't should always work without braces, but then again, |
I'm not very familiar with {shiny}, what about these, are they akin to
Maybe we need |
I don't know all of them, but no. x <- reactiveVal(42)
y <- reactiveValues()
observe({
y$a <- 1
y$b <- 2
}) For shiny, the following usually get a <- reactive({})
b <- observe({})
c <- observeEvent(expr_no_braces, {})
output$a <- renderXXX({}) |
Is that all of these export(renderCachedPlot)
export(renderDataTable)
export(renderImage)
export(renderPlot)
export(renderPrint)
export(renderTable)
export(renderText)
export(renderUI) |
Originally posted by @AshesITR in #2302 (comment)
Test case for
switch()
:Hint at implementation:
See also #2326
The text was updated successfully, but these errors were encountered: