[clang] [clang-format] Allow open brace with trailing comment (no line break) (PR #89956)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 3 14:10:47 PDT 2024


GertyP wrote:

> The comments are not aligned in your example, that does not seem to be the right option to hook on.

I think I've misunderstood your point:  A trailing comments alignment style of 'leave' (i.e. "don't mess around in any way with my trailing comments") seems the most suitable existing option to add this new functionality that extends the "leave alone" approach to now also avoiding otherwise forced line breaks between '{' and trailing comments too,  so a test that preserves any unaligned trailing comments in the test input (`FormatTestComments.cpp`, ln 1437) doesn't seem inappropriate to me.  Is that the example you're referring to?

https://github.com/llvm/llvm-project/pull/89956


More information about the cfe-commits mailing list