Is a common practice to move function's opening brace to next line. How to apply this in class method with astyle (code beautifier)?
example:
// this is an initial C++ code
class Class
{
public:
static int foo(bool x) {
if (x) {
return 42;
} else {
return 0;
}
}
};
modified version should be:
class Class
{
public:
static int foo(bool x)
{ // this brace in next line
if (x) {
return 42;
} else {
return 0;
}
}
};
All my attempts working only for global functions.
Both --style=kr / -A3
and --style=linux / -A8
option should apply to class methods as well.
From the docs:
Brackets are broken from namespace, class, and function definitions. Brackets are attached to statements within a function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With