MyDeveloperDay added inline comments.

================
Comment at: clang/lib/Format/Format.cpp:1265
   LLVMStyle.AllowShortCaseLabelsOnASingleLine = false;
+  LLVMStyle.AllowShortCompoundRequirementOnASingleLine = true;
   LLVMStyle.AllowShortEnumsOnASingleLine = true;
----------------
Backl1ght wrote:
> MyDeveloperDay wrote:
> > why would the default be true, is that what happens today?
> yes
just to clarify so I'm sure (without me having to try it myself), if you hadn't 
introduce this option it would be the equivalent of true.

The only reason I say is we get complained at when we change the default from 
not doing something to doing something. Even if that means before we left it 
alone.

So mostly we normally find the options go through an evolution from   
bool->enum->struct, sometimes it can be better to introduce an enum so we can 
have "Leave" as the default

in such circumstances you let the old behaviour be the default, that way we 
know. That previously unformatted compound statements won't be touch in any 
way. 

```
else if (Style.AllowShortCompoundRequirementOnASingleLine != Leave  && .......)
{
```

Users then have to "positively" buy into your style change one way or another. 
Rather than us imposing a default even if that default seems perfectly 
reasonable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139834/new/

https://reviews.llvm.org/D139834

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to