curdeius added a comment.

In D121451#3395801 <https://reviews.llvm.org/D121451#3395801>, @krasimir wrote:

> This makes me think that we should really consider not adding indent if the 
> first character is punctuation WAI, with rationale:

That was the case before this patch.

> - comments starting with such characters often have special meaning, 
> clang-format errors out on the conservative side to not touch them. Example 
> is stuff like `//!` in Doxygen blocks: 
> https://www.doxygen.nl/manual/docblocks.html (although that's special-handled 
> elsewhere).

I'm aware of these special characters, but I wasn't aware of the fact that `#` 
is a special case too (I don't know proto too much).

> - it's possible to work around this by changing the source code to use `// 
> #`; clang-format will respect indentation in that case (also for other 
> punctuation characters).

Again, that was the case before this patch.

What I wanted to achieve was to only treat a limited list of special 
punctuation characters, not all of them.
As you mentioned, we have at least `///, //<, //!` for Doxygen comments. There 
are more of course.
I think that every (group of) language(s) should have a different way of 
defining whether a given character is special and so should be kept with the 
leading `//`.
I hope it makes sense given that C-language family is pretty different from 
Proto where it comes to comments.
So I'd rather keep the old behaviour for `#` in Proto but not in C-like 
languages.
Is that acceptable?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121451

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

Reply via email to