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
+2 -1
View File
@@ -1,9 +1,10 @@
#pragma once
#include <unordered_map>
#include "common/Singleton.hpp"
#include "messages/Emote.hpp"
#include <unordered_map>
namespace chatterino {
class Badges : public Singleton
-1
View File
@@ -1,7 +1,6 @@
#pragma once
#include "common/Singleton.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/emoji/Emojis.hpp"
#include "providers/ffz/FfzEmotes.hpp"
+2 -2
View File
@@ -3,11 +3,11 @@
#include "common/ChatterinoSetting.hpp"
#include "common/Singleton.hpp"
#include <boost/noncopyable.hpp>
#include <pajlada/signals/signal.hpp>
#include <QFont>
#include <QFontDatabase>
#include <QFontMetrics>
#include <boost/noncopyable.hpp>
#include <pajlada/signals/signal.hpp>
#include <array>
#include <unordered_map>
+1 -1
View File
@@ -1,9 +1,9 @@
#include "singletons/Logging.hpp"
#include "Application.hpp"
#include "singletons/helper/LoggingChannel.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"
#include "singletons/helper/LoggingChannel.hpp"
#include <QDir>
#include <QStandardPaths>
-1
View File
@@ -1,7 +1,6 @@
#pragma once
#include "common/Singleton.hpp"
#include "messages/Message.hpp"
#include "singletons/helper/LoggingChannel.hpp"
+4 -4
View File
@@ -6,6 +6,8 @@
#include "singletons/Paths.hpp"
#include "util/PostToThread.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <QCoreApplication>
#include <QFile>
#include <QJsonArray>
@@ -13,15 +15,13 @@
#include <QJsonObject>
#include <QJsonValue>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
namespace ipc = boost::interprocess;
#ifdef Q_OS_WIN
// clang-format off
# include <QSettings>
# include <Windows.h>
// clang-format on
# include "singletons/WindowManager.hpp"
# include "widgets/AttachedWindow.hpp"
#endif
+2 -2
View File
@@ -1,9 +1,9 @@
#pragma once
#include <QString>
#include <QThread>
#include <boost/optional.hpp>
#include <common/Atomic.hpp>
#include <QString>
#include <QThread>
namespace chatterino {
+3 -3
View File
@@ -1,15 +1,15 @@
#include "singletons/Paths.hpp"
#include "common/Modes.hpp"
#include "singletons/Settings.hpp"
#include "util/CombinePath.hpp"
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QDir>
#include <QStandardPaths>
#include <cassert>
#include "common/Modes.hpp"
#include "util/CombinePath.hpp"
#include <cassert>
using namespace std::literals;
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <QString>
#include <boost/optional.hpp>
#include <QString>
namespace chatterino {
+3 -3
View File
@@ -1,8 +1,5 @@
#pragma once
#include <pajlada/settings/setting.hpp>
#include <pajlada/settings/settinglistener.hpp>
#include "BaseSettings.hpp"
#include "common/Channel.hpp"
#include "common/SignalVector.hpp"
@@ -16,6 +13,9 @@
#include "widgets/Notebook.hpp"
#include "widgets/splits/SplitInput.hpp"
#include <pajlada/settings/setting.hpp>
#include <pajlada/settings/settinglistener.hpp>
using TimeoutButton = std::pair<QString, int>;
namespace chatterino {
+1 -1
View File
@@ -3,9 +3,9 @@
#include "common/Singleton.hpp"
#include "util/RapidJsonSerializeQString.hpp"
#include <pajlada/settings/setting.hpp>
#include <QBrush>
#include <QColor>
#include <pajlada/settings/setting.hpp>
#include <singletons/Settings.hpp>
namespace chatterino {
+1 -1
View File
@@ -4,10 +4,10 @@
#include "common/DownloadManager.hpp"
#include "common/NetworkRequest.hpp"
#include "controllers/notifications/NotificationController.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchCommon.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "singletons/Paths.hpp"
#include "util/StreamLink.hpp"
#include "widgets/helper/CommonTexts.hpp"
+2 -2
View File
@@ -1,10 +1,11 @@
#include "Updates.hpp"
#include "Settings.hpp"
#include "common/Modes.hpp"
#include "common/NetworkRequest.hpp"
#include "common/Outcome.hpp"
#include "common/QLogging.hpp"
#include "common/Version.hpp"
#include "Settings.hpp"
#include "singletons/Paths.hpp"
#include "util/CombinePath.hpp"
#include "util/PostToThread.hpp"
@@ -13,7 +14,6 @@
#include <QMessageBox>
#include <QProcess>
#include <QRegularExpression>
#include "common/QLogging.hpp"
namespace chatterino {
namespace {
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <QString>
#include <pajlada/signals/signal.hpp>
#include <QString>
namespace chatterino {
+15 -15
View File
@@ -1,17 +1,5 @@
#include "singletons/WindowManager.hpp"
#include <QDebug>
#include <QDesktopWidget>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QMessageBox>
#include <QSaveFile>
#include <QScreen>
#include <boost/optional.hpp>
#include <chrono>
#include <QMessageBox>
#include "Application.hpp"
#include "common/Args.hpp"
#include "common/QLogging.hpp"
@@ -28,13 +16,25 @@
#include "util/Clamp.hpp"
#include "util/CombinePath.hpp"
#include "widgets/AccountSwitchPopup.hpp"
#include "widgets/FramelessEmbedWindow.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/FramelessEmbedWindow.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include "widgets/Window.hpp"
#include <boost/optional.hpp>
#include <QDebug>
#include <QDesktopWidget>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QMessageBox>
#include <QSaveFile>
#include <QScreen>
#include <chrono>
namespace chatterino {
namespace {
+2 -2
View File
@@ -1,14 +1,14 @@
#pragma once
#include <memory>
#include "common/Channel.hpp"
#include "common/FlagsEnum.hpp"
#include "common/Singleton.hpp"
#include "common/WindowDescriptors.hpp"
#include "pajlada/settings/settinglistener.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include <memory>
namespace chatterino {
class Settings;
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <QTimer>
#include <pajlada/signals/signal.hpp>
#include <QTimer>
namespace chatterino {
+1 -1
View File
@@ -2,10 +2,10 @@
#include "messages/Message.hpp"
#include <boost/noncopyable.hpp>
#include <QDateTime>
#include <QFile>
#include <QString>
#include <boost/noncopyable.hpp>
#include <memory>