Sort and force grouping of includes (#4172)

This change enforces strict include grouping using IncludeCategories

In addition to adding this to the .clang-format file and applying it in the tests/src and src directories, I also did the following small changes:

    In ChatterSet.hpp, I changed lrucache to a <>include
    In Irc2.hpp, I change common/SignalVector.hpp to a "project-include"
    In AttachedWindow.cpp, NativeMessaging.cpp, WindowsHelper.hpp, BaseWindow.cpp, and StreamerMode.cpp, I disabled clang-format for the windows-includes
    In WindowDescriptors.hpp, I added the missing vector include. It was previously not needed because the include was handled by another file that was previously included first.
    clang-format minimum version has been bumped, so Ubuntu version used in the check-formatting job has been bumped to 22.04 (which is the latest LTS)
This commit is contained in:
pajlada
2022-11-27 19:32:53 +01:00
committed by GitHub
parent f2b35fb7dc
commit 032f290767
247 changed files with 658 additions and 566 deletions
+1
View File
@@ -5,6 +5,7 @@
#include "messages/ImageSet.hpp"
#include <boost/optional.hpp>
#include <functional>
#include <memory>
#include <unordered_map>
+13 -12
View File
@@ -1,27 +1,28 @@
#include "messages/Image.hpp"
#include <QBuffer>
#include <QImageReader>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QTimer>
#include <boost/functional/hash.hpp>
#include <functional>
#include <queue>
#include <thread>
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "common/QLogging.hpp"
#include "debug/AssertInGuiThread.hpp"
#include "debug/Benchmark.hpp"
#include <boost/functional/hash.hpp>
#include <QBuffer>
#include <QImageReader>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QTimer>
#include <functional>
#include <queue>
#include <thread>
#ifndef CHATTERINO_TEST
# include "singletons/Emotes.hpp"
#endif
#include "singletons/WindowManager.hpp"
#include "singletons/helper/GifTimer.hpp"
#include "singletons/WindowManager.hpp"
#include "util/DebugCount.hpp"
#include "util/PostToThread.hpp"
+8 -7
View File
@@ -1,22 +1,23 @@
#pragma once
#include "common/Aliases.hpp"
#include "common/Common.hpp"
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include <pajlada/signals/signal.hpp>
#include <QPixmap>
#include <QString>
#include <QThread>
#include <QTimer>
#include <QVector>
#include <atomic>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include <chrono>
#include <map>
#include <memory>
#include <mutex>
#include <pajlada/signals/signal.hpp>
#include "common/Aliases.hpp"
#include "common/Common.hpp"
namespace chatterino {
namespace detail {
+2 -1
View File
@@ -5,8 +5,9 @@
#include "util/QStringHash.hpp"
#include "widgets/helper/ScrollbarHighlight.hpp"
#include <QTime>
#include <boost/noncopyable.hpp>
#include <QTime>
#include <cinttypes>
#include <memory>
#include <vector>
+1
View File
@@ -3,6 +3,7 @@
#include "messages/MessageElement.hpp"
#include <QRegularExpression>
#include <ctime>
#include <utility>
+3 -2
View File
@@ -6,13 +6,14 @@
#include "messages/MessageColor.hpp"
#include "singletons/Fonts.hpp"
#include <boost/noncopyable.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <QRect>
#include <QString>
#include <QTime>
#include <boost/noncopyable.hpp>
#include <cstdint>
#include <memory>
#include <pajlada/signals/signalholder.hpp>
#include <vector>
namespace chatterino {
+1 -2
View File
@@ -1,7 +1,6 @@
#include "messages/MessageBuilder.hpp"
#include "common/Aliases.hpp"
#include "common/Outcome.hpp"
#include "messages/MessageBuilder.hpp"
#include "messages/MessageColor.hpp"
#include "providers/twitch/TwitchBadge.hpp"
+2 -2
View File
@@ -2,9 +2,9 @@
#include "Application.hpp"
#include "debug/Benchmark.hpp"
#include "messages/layouts/MessageLayoutContainer.hpp"
#include "messages/Message.hpp"
#include "messages/MessageElement.hpp"
#include "messages/layouts/MessageLayoutContainer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
@@ -15,8 +15,8 @@
#include <QApplication>
#include <QDebug>
#include <QPainter>
#include <QThread>
#include <QtGlobal>
#include <QThread>
#define MARGIN_LEFT (int)(8 * this->scale)
#define MARGIN_RIGHT (int)(8 * this->scale)
+2 -1
View File
@@ -3,8 +3,9 @@
#include "common/Common.hpp"
#include "common/FlagsEnum.hpp"
#include <QPixmap>
#include <boost/noncopyable.hpp>
#include <QPixmap>
#include <cinttypes>
#include <memory>
@@ -1,10 +1,10 @@
#include "MessageLayoutContainer.hpp"
#include "Application.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "messages/Message.hpp"
#include "messages/MessageElement.hpp"
#include "messages/Selection.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
@@ -1,14 +1,15 @@
#pragma once
#include <QPoint>
#include <QRect>
#include <memory>
#include <vector>
#include "common/Common.hpp"
#include "common/FlagsEnum.hpp"
#include "messages/Selection.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "messages/Selection.hpp"
#include <QPoint>
#include <QRect>
#include <memory>
#include <vector>
class QPainter;
@@ -5,12 +5,12 @@
#include "messages/MessageColor.hpp"
#include "messages/MessageElement.hpp"
#include <boost/noncopyable.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <QPen>
#include <QPoint>
#include <QRect>
#include <QString>
#include <boost/noncopyable.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <climits>
#include <cstdint>
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "QRegularExpression"
#include "messages/search/MessagePredicate.hpp"
#include "QRegularExpression"
namespace chatterino {