From 095de5ed4ba373a44211ae3eb616139c69a0151a Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 23 Aug 2023 13:46:04 +0200 Subject: [PATCH 1/4] chore(nix): update clang-format to clang-tools 16 Signed-off-by: Sefa Eyeoglu --- nix/dev.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix/dev.nix b/nix/dev.nix index c39e15653..6699cac6a 100644 --- a/nix/dev.nix +++ b/nix/dev.nix @@ -23,6 +23,8 @@ types_or = ["c" "c++" "java" "json" "objective-c"]; }; }; + + tools.clang-tools = pkgs.clang-tools_16; }; }; From 85c23b26de7d8161729abfa3bc94915645192087 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 23 Aug 2023 13:46:23 +0200 Subject: [PATCH 2/4] chore: reformat Signed-off-by: Sefa Eyeoglu --- launcher/Version.h | 20 ++++---------------- launcher/launch/LogModel.h | 2 +- launcher/ui/MainWindow.h | 5 +---- launcher/ui/pages/instance/ServersPage.cpp | 20 ++++---------------- libraries/LocalPeer/src/LocalPeer.cpp | 2 +- tests/FileSystem_test.cpp | 5 +---- 6 files changed, 12 insertions(+), 42 deletions(-) diff --git a/launcher/Version.h b/launcher/Version.h index 92bff9ba9..9c043b013 100644 --- a/launcher/Version.h +++ b/launcher/Version.h @@ -103,14 +103,8 @@ class Version { QString m_fullString; - [[nodiscard]] inline bool isAppendix() const - { - return m_stringPart.startsWith('+'); - } - [[nodiscard]] inline bool isPreRelease() const - { - return m_stringPart.startsWith('-') && m_stringPart.length() > 1; - } + [[nodiscard]] inline bool isAppendix() const { return m_stringPart.startsWith('+'); } + [[nodiscard]] inline bool isPreRelease() const { return m_stringPart.startsWith('-') && m_stringPart.length() > 1; } inline bool operator==(const Section& other) const { @@ -156,14 +150,8 @@ class Version { return m_fullString < other.m_fullString; } - inline bool operator!=(const Section& other) const - { - return !(*this == other); - } - inline bool operator>(const Section& other) const - { - return !(*this < other || *this == other); - } + inline bool operator!=(const Section& other) const { return !(*this == other); } + inline bool operator>(const Section& other) const { return !(*this < other || *this == other); } }; private: diff --git a/launcher/launch/LogModel.h b/launcher/launch/LogModel.h index ba2e4054a..18e51d7e3 100644 --- a/launcher/launch/LogModel.h +++ b/launcher/launch/LogModel.h @@ -30,7 +30,7 @@ class LogModel : public QAbstractListModel { enum Roles { LevelRole = Qt::UserRole }; - private /* types */: + private /* types */: struct entry { MessageLevel::Enum level; QString line; diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index b6f45da2e..0b6144522 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -151,10 +151,7 @@ class MainWindow : public QMainWindow { void deleteGroup(); void undoTrashInstance(); - inline void on_actionExportInstance_triggered() - { - on_actionExportInstanceZip_triggered(); - } + inline void on_actionExportInstance_triggered() { on_actionExportInstanceZip_triggered(); } void on_actionExportInstanceZip_triggered(); void on_actionExportInstanceMrPack_triggered(); void on_actionExportInstanceFlamePack_triggered(); diff --git a/launcher/ui/pages/instance/ServersPage.cpp b/launcher/ui/pages/instance/ServersPage.cpp index 6bf802e63..2142e6c9f 100644 --- a/launcher/ui/pages/instance/ServersPage.cpp +++ b/launcher/ui/pages/instance/ServersPage.cpp @@ -354,14 +354,8 @@ class ServersModel : public QAbstractListModel { } } - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override - { - return parent.isValid() ? 0 : m_servers.size(); - } - int columnCount(const QModelIndex& parent) const override - { - return parent.isValid() ? 0 : COLUMN_COUNT; - } + virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override { return parent.isValid() ? 0 : m_servers.size(); } + int columnCount(const QModelIndex& parent) const override { return parent.isValid() ? 0 : COLUMN_COUNT; } Server* at(int index) { @@ -445,10 +439,7 @@ class ServersModel : public QAbstractListModel { qDebug() << "Changed:" << path; load(); } - void fileChanged(const QString& path) - { - qDebug() << "Changed:" << path; - } + void fileChanged(const QString& path) { qDebug() << "Changed:" << path; } private slots: void save_internal() @@ -492,10 +483,7 @@ class ServersModel : public QAbstractListModel { m_saveTimer.stop(); } - bool saveIsScheduled() const - { - return m_dirty; - } + bool saveIsScheduled() const { return m_dirty; } void updateFSObserver() { diff --git a/libraries/LocalPeer/src/LocalPeer.cpp b/libraries/LocalPeer/src/LocalPeer.cpp index ab528c2a1..bd407042f 100644 --- a/libraries/LocalPeer/src/LocalPeer.cpp +++ b/libraries/LocalPeer/src/LocalPeer.cpp @@ -220,5 +220,5 @@ void LocalPeer::receiveConnection() socket->waitForBytesWritten(1000); socket->waitForDisconnected(1000); // make sure client reads ack delete socket; - emit messageReceived(uMsg); //### (might take a long time to return) + emit messageReceived(uMsg); // ### (might take a long time to return) } diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp index e19410423..1d3cee85f 100644 --- a/tests/FileSystem_test.cpp +++ b/tests/FileSystem_test.cpp @@ -353,10 +353,7 @@ class FileSystemTest : public QObject { } } - void test_getDesktop() - { - QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); - } + void test_getDesktop() { QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); } void test_link() { From d7b6450613b7c106dcc06c6e160ba124990e4e93 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 23 Aug 2023 13:47:04 +0200 Subject: [PATCH 3/4] fix(nix): reload direnv if parts change Signed-off-by: Sefa Eyeoglu --- .envrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.envrc b/.envrc index 3550a30f2..190b5b2b3 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ use flake +watch_file nix/*.nix From 41bd008f5d8d5872e1ab2646c78908e27eae7b73 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 23 Aug 2023 13:49:09 +0200 Subject: [PATCH 4/4] chore(nix): remove pre-commit tools from shell use `pre-commit` CLI instead! Signed-off-by: Sefa Eyeoglu --- nix/dev.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/nix/dev.nix b/nix/dev.nix index 6699cac6a..a9c1dc65d 100644 --- a/nix/dev.nix +++ b/nix/dev.nix @@ -30,13 +30,6 @@ devShells.default = pkgs.mkShell { inherit (self.checks.${system}.pre-commit-check) shellHook; - packages = with pkgs; [ - nodePackages.markdownlint-cli - alejandra - deadnix - clang-tools - nil - ]; inputsFrom = [self.packages.${system}.prismlauncher-unwrapped]; buildInputs = with pkgs; [ccache ninja];