Make clang-format put trailing comments onto newline after opening brace

30 Views Asked by At

We have a lot of code like the following

int functionName(int arg) { // Some comment
    if (condition) { // Why are we here?
        ...
    }
}

Is there a setting to make clang format put the comments following the open braces on a new line?

(e.g.

int functionName(int arg) {
    // Some comment
    if (condition) {
        // Why are we here?
        ...
    }
}

)

We already use clang-format but I can't see how to acheive this. Any help much appreciated!

0

There are 0 best solutions below