D24568: Provide clang-format target with a KDE Frameworks style file

Christoph Cullmann noreply at phabricator.kde.org
Thu Oct 17 19:28:32 BST 2019


cullmann marked an inline comment as done.
cullmann added a comment.


  With
  
  BreakConstructorInitializers: BeforeColon
  
  you get collapsed stuff like;
  
  Range::Range(const KTextEditor::Cursor &c1, const KTextEditor::Cursor c2, MotionType mt) : Range(c1.line(), c1.column(), c2.line(), c2.column(), mt)
  
  I think the behavior of the default of WebKit
  
  BCIS_BeforeComma (in configuration: BeforeComma) Break constructor initializers before the colon and commas, and align the commas with the colon.
  
  Constructor()
  
    : initializer1()
    , initializer2()
  
  is much more reasonable.
  
  One can play with
  
  ConstructorInitializerAllOnOneLineOrOnePerLine (bool)
  If the constructor initializers don’t fit on a line, put each initializer on its own line.
  
  true:
  SomeClass::Constructor()
  
      : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
    return 0;
  
  }
  
  false:
  SomeClass::Constructor()
  
      : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa),
        aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
    return 0;
  
  }
  ConstructorInitializerIndentWidth (unsigned)
  The number of characters to use for indentation of constructor initializer lists as well as inheritance lists.

INLINE COMMENTS

> sitter wrote in KDEClangFormat.cmake:53
> I'm pretty sure you need to check the version the exectuable. When I use 6.0 I get ctors smushed into one line.

No, actually the reason for that is the added BreakConstructorInitializers: BeforeColon
I am not sure how to avoid that if we not go back to the old variant I had without that.

REPOSITORY
  R240 Extra CMake Modules

REVISION DETAIL
  https://phabricator.kde.org/D24568

To: cullmann, #frameworks, dfaure
Cc: sitter, mwolff, ochurlaud, nalvarez, kossebau, aacid, davidedmundson, dhaumann, apol, ognarb, kde-frameworks-devel, kde-buildsystem, LeGast00n, GB_2, bencreasy, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191017/8fc9eef0/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list