<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 29, 2021 at 6:46 AM Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Aug 28, 2021 at 3:40 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
> On Sat, Aug 28, 2021 at 5:52 AM Aaron Ballman <<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>> wrote:<br>
>><br>
>> On Sat, Aug 28, 2021 at 3:48 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>> ><br>
>> > +1 to what Manuel's said here.<br>
>> ><br>
>> > One slight change I'd suggest is changing the term "breaking changes" to "non-whitespace changes", perhaps? (they aren't necessarily breaking anything) At least I assume that's the intent, but I might be wrong in which case I'd love to better understand what's being proposed.<br>
>><br>
>> To me, the crux of my concern isn't nonwhitespace changes, but changes<br>
>> that can make code which used to compile no longer do so. It just so<br>
>> happens that nonwhitespace changes are where that risk is highest, but<br>
>> whitespace changes can impact syntactic validity (such as reformatting<br>
>> preprocessor directives which terminate with an end of line) and<br>
>> nonwhitespace changes can (in theory) be written to not break code<br>
>> (such as inserting parentheses in expressions such that they match the<br>
>> current order of operations used by the expression). So I prefer<br>
>> "breaking changes" because it captures the concern better, but I'd<br>
>> reword it to "potentially breaking changes" to improve clarity. It's<br>
>> not that we expect the option to break significant code (that'd be<br>
>> bad), it's that we anticipate that it *could* break code and that's<br>
>> why it's treated with greater caution.<br>
><br>
><br>
> The language here seems a bit too vague/guarded for my comfort level. Is the expectation then that someone must demonstrate a specific breakage situation (however rare/unlikely?) to justify classifying the formatting feature into this special off-by-default/risky group?<br>
<br>
Sort of? My thinking is: if someone comes up with a test case that the<br>
clang-format developers do not consider to be a bug (and thus don't<br>
intend to "fix" the behavior), then we absolutely should document it<br>
as described. (Also, I think it should be an explicit test case<br>
showing the behavior with a comment about it being expected behavior<br>
-- that helps with communication if someone files a bug about it.) If<br>
no one can come up with a test case that would break, I'd be fine if<br>
we still classified it as a potentially breaking change based on<br>
whitespace vs not whitespace or some other metric, but my bigger point<br>
is that if someone can demonstrate a test case that break that isn't<br>
sufficiently compelling to change the tool to handle better, that<br>
definitely meets the bar for being opt-in.<br></blockquote><div><br>Yeah, this is the vague/uncertain aspects I'm a bit concerned with: If someone comes along with a test case demonstrating a formatting rules can break certain code and folks classify it as effectively "will not fix because it's not worth it/diminishing returns" we now have to change the rule to be off-by-default (where it was possibly on-by-default before). But then if someone decides to fix that bug, because they have a use-case that makes it worthwhile for them to fix it - now we might flip it back to on-by-default?<br><br>If that's unlikely - if most of the time the answers are clear, that the breakage is /super/ expensive to avoid such that no one's likely to ever revisit the decision/have a different cost/benefit tradeoff - and the breakages are obvious/easy to demonstrate (like I said, if there's common types of breakage and so simple breakage patterns that can be used in most cases to demonstrate breakage, etc) then we might avoid these sort of flip/flop cases most of the time.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Perhaps we'll end up with easy idioms/obvious proofs that apply to whole classes (perhaps, for instance, there's an easy/obvious/reusable proof that applies to most cases of token reordering similar to what Arthur showed?) of changes & that'll keep the burden of proof fairly low?<br>
<br>
That seems plausible.<br>
<br>
> In any case, I see the language is intentional, and if the folks working on this are comfortable with it, I'll leave it to you folks - thanks for explaining!<br>
<br>
Any time, thanks for the discussion!<br>
<br>
~Aaron<br>
<br>
><br>
> - Dave<br>
><br>
>><br>
>><br>
>> ~Aaron<br>
>><br>
>> ><br>
>> > On Fri, Aug 27, 2021 at 7:03 AM Manuel Klimek via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>> >><br>
>> >> On Fri, Aug 27, 2021 at 1:43 PM Aaron Ballman via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>> >>><br>
>> >>> Thanks to everyone who participated in the discussion, and especially<br>
>> >>> to MyDeveloperDay for getting this started. Now that discussion on<br>
>> >>> this RFC seems to have died down, I think it's worth circling back to<br>
>> >>> see if we have consensus to move forward. From reading the threads, I<br>
>> >>> think Renato summarized the consensus position nicely:<br>
>> >><br>
>> >><br>
>> >> I agree with the following items:<br>
>> >><br>
>> >>><br>
>> >>> * Breaking changes off by default, override behaviour with configuration files<br>
>> >>> * All behaviour must be controlled by a configuration flag with<br>
>> >>> options explicit on doc/config<br>
>> >>> * Make explicit some options are breaking (comment/naming)<br>
>> >><br>
>> >><br>
>> >> I disagree with this one:<br>
>> >><br>
>> >>><br>
>> >>> * Backwards compatibility is pursued, but can be broken in case of clear bugs<br>
>> >><br>
>> >><br>
>> >> Which I think is also tangential to the current RFC, and IMO should be treated in a separate discussion if necessary (this is a fundamental problem with how clang-format is designed).<br>
>> >><br>
>> >>><br>
>> >>> Unless there is strong opposition to this, then I'd say MyDeveloperDay<br>
>> >>> has an answer to their RFC. Any disagreement?<br>
>> >>><br>
>> >>> ~Aaron<br>
>> >>><br>
>> >>> On Wed, Aug 11, 2021 at 4:37 AM Mehdi AMINI via cfe-dev<br>
>> >>> <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>> >>> ><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > On Tue, Aug 10, 2021 at 5:24 PM Renato Golin via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>> >>> >><br>
>> >>> >> On Tue, 10 Aug 2021 at 15:55, Manuel Klimek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >>> >>><br>
>> >>> >>> I agree that that was probably not obvious or stated very clearly anywhere - clang-format for years was basically developed by a small team without much interest in input by the rest of the world, for a very specific use case.<br>
>> >>> >>> At the time we did not do a great job at spreading our thoughts with the world, as a lot of discussions were in person.<br>
>> >>> >><br>
>> >>> >><br>
>> >>> >> I think there's more to that than what was created by the people who created it.<br>
>> >>> >><br>
>> >>> >> After being used extensively by people around the world, clang-format has perhaps grown to something that the original team did not envision.<br>
>> >>> >><br>
>> >>> >> However, as a public clang tool, and as part of the LLVM "family", it's no longer "a tool used by the team that created it", and not even "a tool used by LLVM developers". It is truly a public tool maintained by the LLVM community.<br>
>> >>> >><br>
>> >>> >> As such, I think we shouldn't restrict the design goals to the original design, or to what a small sub-group uses it for. Clang-format is an official tool like other visible stuff and should have the same community oversight as everything else.<br>
>> >>> >><br>
>> >>> >> There is a high demand for a formatting tool that can do so much more than the original design and people have been using it, albeit precariously, for that purpose already.<br>
>> >>> >><br>
>> >>> >> So I believe the original policy that "breaking changes are a benefit" can still be valid in a number of places, but it does not (and should not) need to be the only valid case. Definitely not the default, either.<br>
>> >>> >><br>
>> >>> >> I think we need to take a step back and ask users what they expect, rather than push forward a policy that people never really wanted but coped with it anyway because there's nothing better.<br>
>> >>> >><br>
>> >>> >> FWIW, borrowing suggestions from others in this thread, I propose we change the policy to:<br>
>> >>> >> * Breaking changes off by default, override behaviour with configuration files<br>
>> >>> >> * All behaviour must be controlled by a configuration flag with options explicit on doc/config<br>
>> >>> >> * Make explicit some options are breaking (comment/naming)<br>
>> >>> >> * Backwards compatibility is pursued, but can be broken in case of clear bugs<br>
>> >>> ><br>
>> >>> ><br>
>> >>> > FWIW, this seems very reasonable to me.<br>
>> >>> > (and it is also what I understood MyDeveloperDay's original proposal to be).<br>
>> >>> ><br>
>> >>> > Cheers,<br>
>> >>> ><br>
>> >>> > --<br>
>> >>> > Mehdi<br>
>> >>> ><br>
>> >>> ><br>
>> >>> >><br>
>> >>> >><br>
>> >>> >> An easy way to manage the configuration in this case is to have a dump function (`clang-format --dump --config foo.cfg`) that reads a config file and dumps all missing parameters and their current values.<br>
>> >>> >><br>
>> >>> >> Inline comments would be nice but make configuration management hard, so there could be a webpage that describes all options and the URL is dumped on the config file.<br>
>> >>> >><br>
>> >>> >> cheers,<br>
>> >>> >> --renato<br>
>> >>> >> _______________________________________________<br>
>> >>> >> cfe-dev mailing list<br>
>> >>> >> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
>> >>> >> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
>> >>> ><br>
>> >>> > _______________________________________________<br>
>> >>> > cfe-dev mailing list<br>
>> >>> > <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
>> >>> > <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
>> >>> _______________________________________________<br>
>> >>> cfe-dev mailing list<br>
>> >>> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
>> >>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> cfe-dev mailing list<br>
>> >> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
>> >> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>