\(x) if (is.na(x)) "CRAN" else cli::cli_fmt(cli::cli_text("{.field {x}} field in DESCRIPTION"))
Currently formatted as
\(x)
if (is.na(x)) "CRAN" else
cli::cli_fmt(cli::cli_text("{.field {x}} field in DESCRIPTION"))
I think in this case it should really be:
\(x) {
if (is.na(x)) {
"CRAN"
} else {
cli::cli_fmt(cli::cli_text("{.field {x}} field in DESCRIPTION"))
}
}
We already planned to force multiline if/else to be wrapped in { } (it's related to #225 and tidyverse/style#240), but I think we should also apply this to function logic too.
i.e. if a user requested line break is already there before the body, or the whole thing can't fit on one line, then forcibly add { }. Because as soon as you add a second statement, you need them anyways.