Details
Diff Detail
Event Timeline
docs/ClangFormatStyleOptions.rst | ||
---|---|---|
218 | nope, bad copy and paste it seems. Sorry | |
461 | Yes, sorry, issue during the copy and paste :( | |
532 | Yes and no. I reported this bug: |
Hm. I don't actually know whether these examples are useful as is. You only present one setting of the value in most cases. What's interesting is actually how the flag changes the behavior. I mean in most cases, this can be derived from the example, but in those cases, it's also fairly obvious what the flag does. Unfortunately, I also don't have a significantly better idea. Maybe something like https://clangformat.com/ is just better at handling this?
include/clang/Format/Format.h | ||
---|---|---|
682 | "update" seems like the wrong word. Maybe "affected"? |
I see a lot of values in examples. If I started this review, it is because I was lost in all the options and could not find what I was looking for.
If you want, I can update the example to provide results with and without the option.
like
With SpacesInCStyleCastParentheses: true:
x = ( int32 )y
With false:
x = (int32)y
Sure, then go ahead. If these examples would have helped you, that's one datapoint :).
As for presenting the difference in options, that would be useful I think. So if you are up to also doing that, that'd be appreciated.
For bool options it seems easiest to do something like:
true: x = ( int32 )y; false: x = (int32)y;
(I'd try to keep this as compact as possible for now as the style page getting much longer also hurts discoverability)
For what it's worth, I also find this useful to be able to see at a glance what the setting does. I know I've tried several different settings in the past before finding the one I was looking for.
For bool options it seems easiest to do something like:
true: x = ( int32 )y;
false: x = (int32)y;
That works for single declarations but for stuff like:
SomeClass::Constructor() : a(a) , b(b) , c(c) {}
I won't be great :/
I agree, just generally we should aim for keeping these short.
The example you gave might actually be reasonable to compare in two columns, i.e.:
true: false: SomeClass::Constructor() vs. SomeClass::Constructor() : a(a), : a(a) b(b), , b(b) c(c) {} , c(c) {}
or some such.
I also think that examples for the flags are good. My use case is that while developing/debugging its nice to see a short example for a random flag in the documentation pop-up.
Daniel, it is good for me now.
Once it is accepted, I will work on the rest in a separate commit if that is ok with you;
Do we really align these 3 spaces out?