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 -2
View File
@@ -1,10 +1,10 @@
#include "BadgePickerDialog.hpp"
#include <QSizePolicy>
#include "singletons/Resources.hpp"
#include "providers/twitch/TwitchBadges.hpp"
#include "singletons/Resources.hpp"
#include <QDialogButtonBox>
#include <QSizePolicy>
#include <QVBoxLayout>
namespace chatterino {
+2 -1
View File
@@ -2,9 +2,10 @@
#include "util/DisplayBadge.hpp"
#include <boost/optional.hpp>
#include <QComboBox>
#include <QDialog>
#include <boost/optional.hpp>
#include <memory>
namespace chatterino {
+1 -2
View File
@@ -6,11 +6,10 @@
#include "widgets/helper/QColorPicker.hpp"
#include <pajlada/signals/signal.hpp>
#include <QLabel>
#include <array>
#include <QLabel>
namespace chatterino {
/**
+2 -2
View File
@@ -12,10 +12,10 @@
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/TrimRegExpValidator.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Scrollbar.hpp"
#include <QAbstractButton>
#include <QHBoxLayout>
-1
View File
@@ -6,7 +6,6 @@
#include "widgets/Notebook.hpp"
#include <pajlada/signals/signal.hpp>
#include <QLineEdit>
namespace chatterino {
@@ -1,4 +1,5 @@
#include "IrcConnectionEditor.hpp"
#include "ui_IrcConnectionEditor.h"
namespace chatterino {
+1 -2
View File
@@ -1,10 +1,9 @@
#pragma once
#include <boost/optional.hpp>
#include "providers/irc/Irc2.hpp"
#include "widgets/BaseWindow.hpp"
#include <boost/optional.hpp>
#include <QDialog>
namespace Ui {
+4 -4
View File
@@ -1,14 +1,14 @@
#include "LastRunCrashDialog.hpp"
#include "singletons/Updates.hpp"
#include "util/LayoutCreator.hpp"
#include "util/PostToThread.hpp"
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include "singletons/Updates.hpp"
#include "util/LayoutCreator.hpp"
#include "util/PostToThread.hpp"
namespace chatterino {
LastRunCrashDialog::LastRunCrashDialog()
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <QDialog>
#include <pajlada/signals/signalholder.hpp>
#include <QDialog>
namespace chatterino {
+1 -1
View File
@@ -12,12 +12,12 @@
# include <Windows.h>
#endif
#include <pajlada/settings/setting.hpp>
#include <QClipboard>
#include <QDebug>
#include <QDesktopServices>
#include <QMessageBox>
#include <QUrl>
#include <pajlada/settings/setting.hpp>
namespace chatterino {
+1 -1
View File
@@ -14,8 +14,8 @@
#include <QLineEdit>
#include <QPushButton>
#include <QTabWidget>
#include <QVBoxLayout>
#include <QtCore/QVariant>
#include <QVBoxLayout>
namespace chatterino {
@@ -7,7 +7,6 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>
#include <QVBoxLayout>
namespace chatterino {
+1
View File
@@ -1,4 +1,5 @@
#include "QualityPopup.hpp"
#include "Application.hpp"
#include "common/QLogging.hpp"
#include "singletons/WindowManager.hpp"
+1 -1
View File
@@ -6,9 +6,9 @@
#include "controllers/hotkeys/HotkeyController.hpp"
#include "messages/MessageThread.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/ResizingTextEdit.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitInput.hpp"
+6 -8
View File
@@ -3,26 +3,24 @@
#include "Application.hpp"
#include "common/QLogging.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "providers/irc/Irc2.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Theme.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/dialogs/IrcConnectionEditor.hpp"
#include "widgets/helper/EditableModelView.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QTableView>
#include "providers/irc/Irc2.hpp"
#include "widgets/helper/EditableModelView.hpp"
#include <QHeaderView>
#include <QPushButton>
#include <QTableView>
#include <QVBoxLayout>
#define TAB_TWITCH 0
#define TAB_IRC 1
+1 -3
View File
@@ -5,11 +5,9 @@
#include "widgets/BaseWindow.hpp"
#include <pajlada/signals/signal.hpp>
#include <QLabel>
#include <QRadioButton>
#include <QLineEdit>
#include <QRadioButton>
namespace chatterino {
+4 -4
View File
@@ -1,16 +1,16 @@
#pragma once
#include "widgets/BaseWindow.hpp"
#include "widgets/helper/SettingsDialogTab.hpp"
#include <pajlada/settings/setting.hpp>
#include <QFrame>
#include <QPushButton>
#include <QStackedLayout>
#include <QVBoxLayout>
#include <QWidget>
#include <functional>
#include <pajlada/settings/setting.hpp>
#include "widgets/helper/SettingsDialogTab.hpp"
#include <QFrame>
#include <functional>
class QLineEdit;
+4 -4
View File
@@ -10,9 +10,9 @@
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/IvrApi.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
#include "providers/twitch/api/Helix.hpp"
#include "singletons/Resources.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
@@ -22,13 +22,13 @@
#include "util/LayoutCreator.hpp"
#include "util/PostToThread.hpp"
#include "util/StreamerMode.hpp"
#include "widgets/Label.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/Window.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/EffectLabel.hpp"
#include "widgets/helper/Line.hpp"
#include "widgets/Label.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/Window.hpp"
#include <QCheckBox>
#include <QDesktopServices>
@@ -5,10 +5,10 @@
#include "singletons/Fonts.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/Window.hpp"
namespace chatterino {
+2 -2
View File
@@ -5,10 +5,10 @@
#include "singletons/Fonts.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/Window.hpp"
namespace chatterino {
@@ -1,8 +1,9 @@
#pragma once
#include <memory>
#include "widgets/listview/GenericListModel.hpp"
#include <memory>
namespace chatterino {
using QuickSwitcherModel = GenericListModel;
@@ -4,13 +4,13 @@
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/switcher/NewPopupItem.hpp"
#include "widgets/dialogs/switcher/NewTabItem.hpp"
#include "widgets/dialogs/switcher/SwitchSplitItem.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/listview/GenericListView.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
namespace chatterino {
@@ -6,10 +6,10 @@
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include <functional>
#include <QLineEdit>
#include <functional>
namespace chatterino {
class GenericListView;
@@ -1,12 +1,11 @@
#pragma once
#include "widgets/dialogs/switcher/AbstractSwitcherItem.hpp"
#include "singletons/WindowManager.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/switcher/AbstractSwitcherItem.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/Window.hpp"
namespace chatterino {