Require curlies for if statement body
I don't know how easy this one is or if it falls in the purview of CFFormat since it's actually adding code, not just whitespace. One of my big pet peeves is this:
if( condition )
randomOrphan.codeThatCanGetSeperated();
I'd love to see an option to change it to this:
if( condition ) {
niceCodeSecurley.insideIfBody();
}
Interesting, I think this might be doable. If the code is correct to start with, it certainly should be.
@bdw429s Just to clarify, you're looking for an option to make the curlies required, right? That is, the requirement could be turned off for those who prefer the more succinct code.
@mjclemente If by "succinct code", you meant, "horrible lazy bad code", then yes exactly! :laughing: j/k if you like it the succinct way. It would be an optional formatting option to auto-add the curlies for people who wanted it.
🤣
if( curliesAreNotNeeded )
party.withoutThem();
Makes sense to me. I don't feel strongly, except about having options.
I just want CFFormat to not take this:
if( condition )
randomOrphan.codeThatCanGetSeperated();
and format it to this:
if( condition ) randomOrphan.codeThatCanGetSeperated();