Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set comment's line length in clang-format?

From this thread, I know ColumnLimit can set code line length. But it also influences comment line length, and I don't wish it to be controlled by ColumnLimit.

How to specify comment line length when ColumnLimit has been set?

like image 907
Chen Li Avatar asked Oct 15 '25 05:10

Chen Li


1 Answers

If I understand your comment correctly, you're saying that breaking comments into lines will hinder some functionality in some other code analysis program. In that case, you may turn clang format off and back on for part of your code:

// clang-format off
void codeThatWontBeFormatted() // my very long comment that won't be formatted
{
}
// clang-format on
like image 183
The Quantum Physicist Avatar answered Oct 18 '25 13:10

The Quantum Physicist



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!