-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
Description
Hi,
I want to achieve this formatting effect:
class D : public A, public B, public C
{
public:
int id_c;
};
typedef enum : int
{
ALL = 0,
DEBUG = 1,
INFO = 2,
WARN = 3,
ERROR = 4,
} log_level_t;I want to use Mozilla style, so I generated .clang-format with Mozilla style parameters:
clang-format -style=mozilla -dump-config > .clang-formatAfter formatting using this .clang-format file, I got the following:
class D
: public A
, public B
, public C
{
public:
int id_c;
};
typedef enum
: int
{
ALL = 0,
DEBUG = 1,
INFO = 2,
WARN = 3,
ERROR = 4,
} log_level_t;Trying to achieve my formatting goal, I found those values in the .clang-format file:
# BasedOnStyle: Mozilla
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeComma
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeCommaI want to disable line breaks, but there's no false value for those parameters:
# It doesn't work
BasedOnStyle: Mozilla
BreakConstructorInitializers: false
BreakConstructorInitializers: falseI was only able to get the effect I wanted by commenting on the relevant parameters:
# BasedOnStyle: Mozilla
BreakBeforeInheritanceComma: false
#BreakInheritanceList: BeforeComma
BreakConstructorInitializersBeforeComma: false
#BreakConstructorInitializers: BeforeCommaHowever, with this solution, I have to copy all the parameters from the Mozilla style instead of using BasedOnStyle: Mozilla.
Shouldn't there be an option to disable those parameters connected with breaks?