[cfe-dev] ClangFormat Additional Options Proposal

Haroogan Haroogan at gmail.com
Sun Apr 20 20:55:28 PDT 2014


Hello,

I have a few options for ClangFormat to propose:

1. `BreakAfterScopeResolutionOperatorInFunctionDeclarationAndDefinition'.
Example:

  Before:

    void Namespace1::Namespace2::Class::Method(int parameter);

  After:

    void Namespace1::
         Namespace2::
         Class::
    Method(int parameter);

2. `BreakAfterReturnTypeInFunctionDeclarationAndDefinition'. Example:

  Before:

    void Method(int parameter);

  After:

    void
    Method(int parameter);

When both are turned on, this would give a neat look:

    void
    Namespace1::
    Namespace2::
    Class::
    Method(int parameter);

Since I prefer to stick to 80 column limit, I personally have this setup
turned on for every project I participate (using another formatter) as it
prevents otherwise ugly wrapping of long namespace names and function names
and makes code easy to follow. I'd really like to see these options to make
it into the next release of ClangFormat.

Looking forward to your feedback. Thanks!

Regards,
Alexander



--
View this message in context: http://clang-developers.42468.n3.nabble.com/ClangFormat-Additional-Options-Proposal-tp4038901.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list