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
+3 -3
View File
@@ -1,13 +1,13 @@
#include "Button.hpp"
#include "singletons/Theme.hpp"
#include "util/FunctionEventFilter.hpp"
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QPainter>
#include "singletons/Theme.hpp"
#include "util/FunctionEventFilter.hpp"
namespace chatterino {
namespace {
+1 -2
View File
@@ -1,9 +1,8 @@
#pragma once
#include <boost/optional.hpp>
#include "widgets/BaseWidget.hpp"
#include <boost/optional.hpp>
#include <QMenu>
#include <QMouseEvent>
#include <QPainter>
+23 -22
View File
@@ -1,22 +1,5 @@
#include "ChannelView.hpp"
#include <QClipboard>
#include <QColor>
#include <QDate>
#include <QDebug>
#include <QDesktopServices>
#include <QEasingCurve>
#include <QGraphicsBlurEffect>
#include <QMessageBox>
#include <QPainter>
#include <QScreen>
#include <QVariantAnimation>
#include <algorithm>
#include <chrono>
#include <cmath>
#include <functional>
#include <memory>
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/QLogging.hpp"
@@ -24,12 +7,12 @@
#include "controllers/commands/CommandController.hpp"
#include "debug/Benchmark.hpp"
#include "messages/Emote.hpp"
#include "messages/layouts/MessageLayout.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "messages/LimitedQueueSnapshot.hpp"
#include "messages/Message.hpp"
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
#include "messages/layouts/MessageLayout.hpp"
#include "messages/layouts/MessageLayoutElement.hpp"
#include "providers/LinkResolver.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchIrcServer.hpp"
@@ -44,16 +27,34 @@
#include "util/IncognitoBrowser.hpp"
#include "util/StreamerMode.hpp"
#include "util/Twitch.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/TooltipWidget.hpp"
#include "widgets/Window.hpp"
#include "widgets/dialogs/ReplyThreadPopup.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/dialogs/UserInfoPopup.hpp"
#include "widgets/helper/EffectLabel.hpp"
#include "widgets/helper/SearchPopup.hpp"
#include "widgets/Scrollbar.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitInput.hpp"
#include "widgets/TooltipWidget.hpp"
#include "widgets/Window.hpp"
#include <QClipboard>
#include <QColor>
#include <QDate>
#include <QDebug>
#include <QDesktopServices>
#include <QEasingCurve>
#include <QGraphicsBlurEffect>
#include <QMessageBox>
#include <QPainter>
#include <QScreen>
#include <QVariantAnimation>
#include <algorithm>
#include <chrono>
#include <cmath>
#include <functional>
#include <memory>
#define DRAW_WIDTH (this->width())
#define SELECTION_RESUME_SCROLLING_MSG_THRESHOLD 3
+11 -10
View File
@@ -1,15 +1,5 @@
#pragma once
#include <QPaintEvent>
#include <QScroller>
#include <QTimer>
#include <QVariantAnimation>
#include <QWheelEvent>
#include <QWidget>
#include <pajlada/signals/signal.hpp>
#include <unordered_map>
#include <unordered_set>
#include "common/FlagsEnum.hpp"
#include "controllers/filters/FilterSet.hpp"
#include "messages/Image.hpp"
@@ -18,6 +8,17 @@
#include "messages/Selection.hpp"
#include "widgets/BaseWidget.hpp"
#include <pajlada/signals/signal.hpp>
#include <QPaintEvent>
#include <QScroller>
#include <QTimer>
#include <QVariantAnimation>
#include <QWheelEvent>
#include <QWidget>
#include <unordered_map>
#include <unordered_set>
namespace chatterino {
enum class HighlightState;
+2 -2
View File
@@ -1,17 +1,17 @@
#include "EditableModelView.hpp"
#include "widgets/helper/RegExpItemDelegate.hpp"
#include <QAbstractItemView>
#include <QAbstractTableModel>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QModelIndex>
#include <QPushButton>
#include <QTableView>
#include <QVBoxLayout>
#include <QLabel>
namespace chatterino {
EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
+1 -2
View File
@@ -1,8 +1,7 @@
#pragma once
#include <QWidget>
#include <pajlada/signals/signal.hpp>
#include <QWidget>
class QAbstractTableModel;
class QTableView;
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include "widgets/BaseWidget.hpp"
#include "widgets/Label.hpp"
#include "widgets/helper/Button.hpp"
#include "widgets/helper/SignalLabel.hpp"
#include "widgets/Label.hpp"
#include <QHBoxLayout>
#include <QLabel>
+3 -3
View File
@@ -1,17 +1,17 @@
#include "widgets/helper/NotebookButton.hpp"
#include "singletons/Theme.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/helper/Button.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include <QMimeData>
#include <QMouseEvent>
#include <QPainter>
#include <QPainterPath>
#include <QRadialGradient>
#include <QMimeData>
#define nuuls nullptr
namespace chatterino {
+3 -3
View File
@@ -10,19 +10,19 @@
#include "singletons/WindowManager.hpp"
#include "util/Clamp.hpp"
#include "util/Helpers.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include <boost/bind/bind.hpp>
#include <QApplication>
#include <QDebug>
#include <QDialogButtonBox>
#include <QLabel>
#include <QLineEdit>
#include <QLinearGradient>
#include <QLineEdit>
#include <QMimeData>
#include <QPainter>
#include <boost/bind/bind.hpp>
namespace chatterino {
namespace {
+3 -3
View File
@@ -2,13 +2,13 @@
#include "common/Common.hpp"
#include "widgets/BaseWidget.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/helper/Button.hpp"
#include "widgets/Notebook.hpp"
#include <QMenu>
#include <QPropertyAnimation>
#include <pajlada/settings/setting.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <QMenu>
#include <QPropertyAnimation>
namespace chatterino {
+1 -2
View File
@@ -38,11 +38,10 @@
****************************************************************************/
#include "widgets/helper/QColorPicker.hpp"
#include <qdrawutil.h>
#include <QMouseEvent>
#include <QPainter>
#include <qdrawutil.h>
/*
* These classes are literally copied from the Qt source.
* Unfortunately, they are private to the QColorDialog class so we cannot use
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include <pajlada/signals/signal.hpp>
#include <QCompleter>
#include <QKeyEvent>
#include <QTextEdit>
#include <pajlada/signals/signal.hpp>
namespace chatterino {
+2 -2
View File
@@ -1,9 +1,9 @@
#pragma once
#include <memory>
#include <QColor>
#include <memory>
namespace chatterino {
class ScrollbarHighlight
+4 -4
View File
@@ -1,9 +1,5 @@
#include "SearchPopup.hpp"
#include <QHBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include "common/Channel.hpp"
#include "controllers/hotkeys/HotkeyController.hpp"
#include "messages/search/AuthorPredicate.hpp"
@@ -17,6 +13,10 @@
#include "singletons/WindowManager.hpp"
#include "widgets/helper/ChannelView.hpp"
#include <QHBoxLayout>
#include <QLineEdit>
#include <QPushButton>
namespace chatterino {
ChannelPtr SearchPopup::filter(const QString &text, const QString &channelName,
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "ForwardDecl.hpp"
#include "controllers/filters/FilterSet.hpp"
#include "ForwardDecl.hpp"
#include "messages/LimitedQueueSnapshot.hpp"
#include "messages/search/MessagePredicate.hpp"
#include "widgets/BasePopup.hpp"
+1
View File
@@ -1,4 +1,5 @@
#include "widgets/helper/SettingsDialogTab.hpp"
#include "widgets/dialogs/SettingsDialog.hpp"
#include "widgets/settingspages/SettingsPage.hpp"
+1
View File
@@ -5,6 +5,7 @@
#include <QIcon>
#include <QPaintEvent>
#include <QWidget>
#include <functional>
namespace chatterino {
+2 -2
View File
@@ -1,9 +1,9 @@
#include "TitlebarButton.hpp"
#include <QPainterPath>
#include "singletons/Theme.hpp"
#include <QPainterPath>
namespace chatterino {
TitleBarButton::TitleBarButton()