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

Vlad Zahorodnii noreply at phabricator.kde.org
Thu Oct 17 19:56:30 BST 2019


zzag added inline comments.

INLINE COMMENTS

> dfaure wrote in clang-format.cmake:75
> typo: ternary

I've been always wondering how one should break long ternary operators when writing KF code. There are several ways to do it

(a) w/o breaking (BreakBeforeTernaryOperators: false)

  const FooBar *foobar = someStupidCondition() ?
      someSuperDuperBeatifulFunctionWithLongName() :
      anotherSuperDuperBeatifuuuulFunctionWithLongName();

(b) w/ breaking (BreakBeforeTernaryOperators: true)

  const FooBar *foobar = someStupidCondition()
      ? someSuperDuperBeatifulFunctionWithLongName()
      : anotherSuperDuperBeatifuuuulFunctionWithLongName();

According to the _clang-format file from the qt5 super repo, Qt fellas prefer (b) to break before ternary operators.

Do we really want to not break before ternary opeartors?

REPOSITORY
  R240 Extra CMake Modules

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

To: cullmann, #frameworks, dfaure
Cc: zzag, 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-buildsystem/attachments/20191017/6fa3745e/attachment-0001.html>


More information about the Kde-buildsystem mailing list