You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New argument for implicit_assignment_linter allowing lazy assignment #2016
The version that seems preferred gets close to an unnecessary_nested_if() violation:
if (rare_condition1&&rare_condition2) {
key<-valif (foo(key)) {
bar(key)
}
}
This increases the indentation vs. the original version; this problem gets worse (possibly combinatorially) if there's more than one such assignment in the same if() condition.
IINM this is a subset of #2015, but still could be used in different situations. Again there's no such carveout in the style guide, so this usage should be disallowed by default.
Activity
AshesITR commentedon Jul 27, 2023
Wasteful in the sense that
keycan't begc()ed immediately after the if branch?MichaelChirico commentedon Jul 27, 2023
more importantly we could have
key <- costly_call()that can be avoided