From 728bdc85bc88017020d4349e984d0514a2e25566 Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Tue, 30 Jun 2026 03:17:52 +0200 Subject: [PATCH] fix(clang-tidy/analyzer): resolving false positives --- .clang-tidy | 5 +++++ Plugins/ZShell/Internal/cachingimagemanager.cpp | 1 + Plugins/ZShell/Models/filesystemmodel.cpp | 2 ++ Plugins/ZShell/Services/audiocollector.cpp | 1 + Plugins/ZShell/appdb.cpp | 1 + Plugins/ZShell/qalculator.cpp | 1 + 6 files changed, 11 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 5246243..99690c3 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,6 +2,11 @@ Checks: > -*, bugprone-*, + -readability-redundant-inline-specifier + -bugprone-throwing-static-initialization + -bugprone-invalid-enum-default-initialization + -bugprone-suspicious-include + -bugprone-branch-clone -bugprone-easily-swappable-parameters, -bugprone-narrowing-conversions, -bugprone-implicit-widening-of-multiplication-result, diff --git a/Plugins/ZShell/Internal/cachingimagemanager.cpp b/Plugins/ZShell/Internal/cachingimagemanager.cpp index e53bf42..58e3112 100644 --- a/Plugins/ZShell/Internal/cachingimagemanager.cpp +++ b/Plugins/ZShell/Internal/cachingimagemanager.cpp @@ -170,6 +170,7 @@ void CachingImageManager::updateSource(const QString& path) { }); watcher->setFuture(future); + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } QUrl CachingImageManager::cachePath() const { diff --git a/Plugins/ZShell/Models/filesystemmodel.cpp b/Plugins/ZShell/Models/filesystemmodel.cpp index d0769d5..02f18f0 100644 --- a/Plugins/ZShell/Models/filesystemmodel.cpp +++ b/Plugins/ZShell/Models/filesystemmodel.cpp @@ -258,6 +258,7 @@ void FileSystemModel::watchDirIfRecursive(const QString& path) { }); watcher->setFuture(future); } + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } void FileSystemModel::update() { @@ -405,6 +406,7 @@ void FileSystemModel::updateEntriesForDir(const QString& dir) { }); watcher->setFuture(future); + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) } void FileSystemModel::applyChanges( diff --git a/Plugins/ZShell/Services/audiocollector.cpp b/Plugins/ZShell/Services/audiocollector.cpp index a9382e3..02f7e2a 100644 --- a/Plugins/ZShell/Services/audiocollector.cpp +++ b/Plugins/ZShell/Services/audiocollector.cpp @@ -253,6 +253,7 @@ AudioCollector::AudioCollector(QObject* parent) , m_writeBuffer(&m_buffer2) {} AudioCollector::~AudioCollector() { + // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall) stop(); } diff --git a/Plugins/ZShell/appdb.cpp b/Plugins/ZShell/appdb.cpp index a62cf59..a34398e 100644 --- a/Plugins/ZShell/appdb.cpp +++ b/Plugins/ZShell/appdb.cpp @@ -9,6 +9,7 @@ namespace ZShell { AppEntry::AppEntry(QObject* entry, unsigned int frequency, QObject* parent) : QObject(parent), m_entry(entry), m_frequency(frequency) { const auto mo = m_entry->metaObject(); + // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall) const auto tmo = metaObject(); for (const auto& prop : diff --git a/Plugins/ZShell/qalculator.cpp b/Plugins/ZShell/qalculator.cpp index 944449e..af73867 100644 --- a/Plugins/ZShell/qalculator.cpp +++ b/Plugins/ZShell/qalculator.cpp @@ -6,6 +6,7 @@ namespace ZShell { Qalculator::Qalculator(QObject* parent) : QObject(parent) { if (!CALCULATOR) { + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) new Calculator(); CALCULATOR->loadExchangeRates(); CALCULATOR->loadGlobalDefinitions();