Weird formatting with multiline variable declarations in C++
Version
$ astyle --version
Artistic Style Version 3.3
Example
Input
class A {
private:
static float property_a, property_b, property_c;
}
// C++
float A::property_a = 0,
A::property_b = 0,
A::property_c = 0;
// C
float A_property_a = 0,
A_property_b = 0,
A_property_c = 0;
Expected Output
class A {
private:
static float property_a, property_b, property_c;
}
// C++
float A::property_a = 0,
A::property_b = 0,
A::property_c = 0;
// C
float A_property_a = 0,
A_property_b = 0,
A_property_c = 0;
Actual Output
class A {
private:
static float property_a, property_b, property_c;
}
// C++
float A::property_a = 0,
A::property_b = 0,
A::property_c = 0;
// C
float A_property_a = 0,
A_property_b = 0,
A_property_c = 0;
.astylerc
# Braces
style=attach
attach-namespaces
attach-classes
attach-inlines
attach-extern-c
attach-closing-while
# Indentation
indent=spaces=4
indent-classes
indent-switches
indent-after-parens
indent-preproc-block
indent-preproc-define
# Padding
pad-oper
pad-comma
pad-header
unpad-paren
unpad-brackets
squeeze-ws
align-pointer=name
# Formatting
break-one-line-headers
add-braces
attach-return-type
attach-return-type-decl
convert-tabs
#max-code-length=#
# Other
lineend=linux
Description
I'm not sure if this is intentional, but multi-line C++ (but not plain C) variable declarations are wrapped oddly in my opinion. Thanks!