The answer of the related post how to make clang-format add new line before opening brace of a function? does not help.
I am using clang-format 9.0.0 with Cppstyle in Eclipse CDT on Windows. clang-format formats the following getter like this:
int returnNumber() { return 3; }
but I prefer the format
int returnNumber()
{
return 3;
}
I have not been able to make clang-format do that, neither with breaking style BS_Allman
nor with a custom style. Is there another solution than manual formatting?
My example source file looks like this:
Header.h
#pragma once
namespace Test
{
class MyClass
{
public:
int returnNumber() { return 3; }
};
} /* namespace Test */
And my configuration file looks like this:
Language: Cpp
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBraces: Allman
ColumnLimit: '80'
IndentWidth: '2'
NamespaceIndentation: None
Standard: Cpp11
TabWidth: '2'
UseTab: Always
PointerAlignment: Left
AlignAfterOpenBracket: DontAlign
BreakConstructorInitializers: AfterColon
MaxEmptyLinesToKeep: 2