I am trying to use clang-format to clean up code in my repository. We are using the WebKit style as the basis for formatting, however we also want to make sure that multi line comments are formatted correctly.
From my understanding it is possible override the formatting rules of given style by define the .clang-format file as such:
BasedOnStyle: WebKit
AlignTrailingComments: true
This way clang-format should align the trailing comments.
Given the input file:
/**
* This is a multi-line comment
*/
void function() {
/**
* This is comment inside the function
*/
}
My expectation is the following output
/**
* This is a multi-line comment
*/
void function()
{
/**
* This is comment inside the function
*/
}
However what I get is:
/**
* This is a multi-line comment
*/
void function()
{
/**
* This is comment inside the function
*/
}
I've tried dumping out the formatting options of Webkit into a .clang-format file and changing the AlignTrailingComments from false to true. This doesn't make and difference either.
Is there some option in the Webkit style that is interfering with the AlignTrailingComments option?
//
after a line of code, no?). Looks like a bug: start of the block gets aligned, but the rest doesn't. – stijn