From 4aa5b04e375d4cbf7f42bec5ec1307957aae6072 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 7 May 2022 16:57:26 +0200 Subject: [PATCH] Disable formatting on "contested lines" (#3714) These lines are formatted differently between clang-format 10 (on CI) and clang-format 11+ (on most dev systems) --- src/messages/MessageBuilder.hpp | 5 ++++- src/util/LayoutCreator.hpp | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/messages/MessageBuilder.hpp b/src/messages/MessageBuilder.hpp index 9623d7937..365049d40 100644 --- a/src/messages/MessageBuilder.hpp +++ b/src/messages/MessageBuilder.hpp @@ -63,7 +63,10 @@ public: void addLink(const QString &origLink, const QString &matchedLink); template - T *emplace(Args &&... args) + // clang-format off + // clang-format can be enabled once clang-format v11+ has been installed in CI + T *emplace(Args &&...args) + // clang-format on { static_assert(std::is_base_of::value, "T must extend MessageElement"); diff --git a/src/util/LayoutCreator.hpp b/src/util/LayoutCreator.hpp index 4ca95db57..82f729d26 100644 --- a/src/util/LayoutCreator.hpp +++ b/src/util/LayoutCreator.hpp @@ -43,7 +43,10 @@ public: } template - LayoutCreator emplace(Args &&... args) + // clang-format off + // clang-format can be enabled once clang-format v11+ has been installed in CI + LayoutCreator emplace(Args &&...args) + // clang-format on { T2 *t = new T2(std::forward(args)...); @@ -184,7 +187,10 @@ private: }; template -LayoutCreator makeDialog(Args &&... args) +// clang-format off +// clang-format can be enabled once clang-format v11+ has been installed in CI +LayoutCreator makeDialog(Args &&...args) +// clang-format on { T *t = new T(std::forward(args)...); t->setAttribute(Qt::WA_DeleteOnClose);