On Mon, Jan 18, 2016 at 11:02 PM, Larry Hastings <larry at hastings.org> wrote:
> On 01/18/2016 03:57 AM, Chris Angelico wrote:
>> Rather than forcing people to use braces, wouldn't it be easier to
> just add a linter to the toolchain that will detect those kinds of
> problems and reject the commit?
>>> I don't understand your suggestion. If we automatically reject commits that
> lack this style of braces, then surely we are "forcing people to use
> [them]"?
Only in the exact situation that this is trying to prevent, where
indentation implies something that braces don't stipulate. From the
original Apple bug link:
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
Since there are two indented lines after the if and no braces, this
should be flagged as an error. If there's only one indented line,
braces are optional.
ChrisA