implement conditionals require braces

Description

Overview: Conditionals should always be formatted with braces, no exceptions, not even for one-liners. Consistency is king. Clarity is king. Consistency and clarity are co-kings.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Zak Burke May 19, 2022 at 2:56 PM

Many good points, , and you're certainly correct that many people don't share my thinking on this.

Jason Skomorowski March 1, 2022 at 2:27 PM
Edited

While I and any sane person agree multi-line if without braces is always wrong, I don't think there is as nearly that much consensus around your opinion here (as demonstrated by the AirBnB config we went with for our defaults allowing oneliners).

If consistency is a co-king does the fact you want us to change every instance of:

to:

mean that we should, for consistency, also change:

to:

And (if ternaries can even have blocks?):

to:

But sure, I guess.  If you really want, I'm okay with whatever. Especially if you're tidying up all the lint warnings. Because it's just not worth spending more attention, I think just having said this will suffice for me to move on.

Won't Do

Details

Assignee

Reporter

Priority

Development Team

Prokopovych

RCA Group

TBD

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created March 1, 2022 at 4:07 AM
Updated May 19, 2022 at 2:56 PM
Resolved May 19, 2022 at 2:56 PM
TestRail: Cases
TestRail: Runs