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
This rule would encourage the use of normal if statements over trailing ones. Trailing if can be hard to use when line debugging via gbd or codelldb. For example:
deffoo(bar)
* bar.baz if bar
end
When using CodeLLDB and the code stops here, it's very hard to know where on the line the break point stops at. This is in comparison to:
deffoo(bar)
if bar
* bar.baz
endend
Which is a lot more clear.
I intend for this rule to be disabled by default.
The text was updated successfully, but these errors were encountered:
This would be a general problem with debugging though. Other languages, even C, have single-line conditions. So it might be interesting to see if there are some ideas to improve this?
It feels a bit odd to introduce a linter rule just to address limitations of the debugging process. Even if it's disabled by default.
I suppose it might also be useful if you want to disallow trailing conditionals entirely in your codebase for stylistic reasons.
Or if you want to automatically rewrite them into multi-liners, as this should be easy to auto-fix.
That's a fair point. My reasoning for this rule does stem beyond just debugging reasons, into general style, but I thought debugging was the most compelling.
This rule would encourage the use of normal
if
statements over trailing ones. Trailingif
can be hard to use when line debugging via gbd or codelldb. For example:When using CodeLLDB and the code stops here, it's very hard to know where on the line the break point stops at. This is in comparison to:
Which is a lot more clear.
I intend for this rule to be disabled by default.
The text was updated successfully, but these errors were encountered: