[poppler] Do we want to enable readability-braces-around-statements ?
Oliver Sander
oliver.sander at tu-dresden.de
Thu Mar 3 14:33:35 UTC 2022
John's answer below quite exactly reflects my own opinion about this.
Best,
Oliver
On 03.03.22 09:59, jcupitt at gmail.com wrote:
> gcc at least (clang too I think) will warn for misleading indentation,
> so I think forcing braces probably won't add much extra safety.
>
> Braces for single lines adds extra visual noise and reduces the code
> you can see at a glance, so some people argue there's actually a small
> downside to using them. I believe Chrome's code standard requires the
> removal of braces on single lines for this reason.
>
> (Of course this is a minor bikeshedding issue and it doesn't matter much.)
>
> John
>
> On Wed, 2 Mar 2022 at 23:39, Albert Astals Cid <aacid at kde.org> wrote:
>>
>> It forces to add a pair of {} to all if/for/while/etc
>>
>> https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/1091
>>
>> (it fails in Qt autogenerated files for now, i can fix that if we agree we want it)
>>
>> I can see it being potentially annoying when CI fails because of this but on the other hand it seems it's always safer to include the braces to not fall into the trap of adding a line indented but that it's not really inside the if block
>>
>> What do you'all think?
>>
>> Cheers,
>> Albert
>>
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5198 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20220303/9164c452/attachment.bin>
More information about the poppler
mailing list