From 22e87b5aea2582e1a0185ae67f0f8728d983aa95 Mon Sep 17 00:00:00 2001 From: silverqx Date: Fri, 3 May 2024 11:45:24 +0200 Subject: [PATCH] revisited bugprone-exception-escape --- include/orm/tiny/model.hpp | 1 - tests/auto/functional/orm/tiny/model/tst_model.cpp | 3 +-- tests/database/seeders/phoneseeder.hpp | 3 +-- tests/models/models/album.hpp | 3 +-- tests/models/models/albumimage.hpp | 3 +-- tests/models/models/datetime.hpp | 3 +-- tests/models/models/datetime_serializeoverride.hpp | 3 +-- tests/models/models/filepropertyproperty.hpp | 3 +-- tests/models/models/massassignmentmodels.hpp | 12 ++++-------- tests/models/models/phone.hpp | 3 +-- tests/models/models/role.hpp | 3 +-- tests/models/models/roleuser.hpp | 3 +-- tests/models/models/roleuser_appends.hpp | 3 +-- tests/models/models/setting.hpp | 3 +-- tests/models/models/tag.hpp | 3 +-- tests/models/models/tag_returnrelation.hpp | 3 +-- tests/models/models/tagged.hpp | 3 +-- tests/models/models/tagproperty.hpp | 3 +-- tests/models/models/torrent.hpp | 3 +-- tests/models/models/torrent_returnrelation.hpp | 3 +-- tests/models/models/torrenteager.hpp | 3 +-- tests/models/models/torrenteager_failed.hpp | 3 +-- tests/models/models/torrenteager_withdefault.hpp | 3 +-- .../models/models/torrenteager_without_qdatetime.hpp | 3 +-- tests/models/models/torrentpeer.hpp | 3 +-- tests/models/models/torrentpeereager.hpp | 3 +-- tests/models/models/torrentpeereager_norelations.hpp | 3 +-- tests/models/models/torrentpreviewablefile.hpp | 3 +-- tests/models/models/torrentpreviewablefileeager.hpp | 3 +-- .../torrentpreviewablefileeager_withdefault.hpp | 3 +-- .../models/models/torrentpreviewablefileproperty.hpp | 3 +-- .../models/torrentpreviewablefilepropertyeager.hpp | 3 +-- tests/models/models/torrentstate.hpp | 3 +-- tests/models/models/type.hpp | 3 +-- tests/models/models/user.hpp | 3 +-- tom/include/tom/tomtypes.hpp | 2 +- 36 files changed, 38 insertions(+), 76 deletions(-) diff --git a/include/orm/tiny/model.hpp b/include/orm/tiny/model.hpp index deb77dcda..a74d7c6ac 100644 --- a/include/orm/tiny/model.hpp +++ b/include/orm/tiny/model.hpp @@ -2227,7 +2227,6 @@ TINYORM_END_COMMON_NAMESPACE // BUG qmake, clang-cl (win32-clang-msvc) ctrl+shift+alt+b fails with: fatal error: PCH file 'debug\TinyOrm_pch.pch' not found: module file not found silverqx // BUG ccache, msvc and clang-cl support doesn't work because of /Zi param. https://github.com/ccache/ccache/issues/1040 silverqx // FUTURE security workflows, add ggshield https://github.com/GitGuardian/ggshield silverqx -// BUG clang tidy reports bugprone-exception-escape for Model class, it doesn't mean that code is buggy or can crash, it means that some defualt method generated by the compiler that should be generated noexcet was generetad as throwing silverqx // CUR mariadb workflows silverqx // FEATURE HidesAttributes, and ModelsCollection::makeVisible/Hidden, ... silverqx // TODO vcpkg, workflows enable binary caching https://learn.microsoft.com/en-us/vcpkg/users/binarycaching#gha silverqx diff --git a/tests/auto/functional/orm/tiny/model/tst_model.cpp b/tests/auto/functional/orm/tiny/model/tst_model.cpp index 53638be99..4dcf0405c 100644 --- a/tests/auto/functional/orm/tiny/model/tst_model.cpp +++ b/tests/auto/functional/orm/tiny/model/tst_model.cpp @@ -1802,8 +1802,7 @@ tst_Model::addTouch_setTouchedRelations_getTouchedRelations_touches_clearTouches namespace { - // NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) - class Role_WithoutUDates final : public Model + class Role_WithoutUDates final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/database/seeders/phoneseeder.hpp b/tests/database/seeders/phoneseeder.hpp index d80624d81..250a4d302 100644 --- a/tests/database/seeders/phoneseeder.hpp +++ b/tests/database/seeders/phoneseeder.hpp @@ -9,8 +9,7 @@ #ifndef TINYORM_DISABLE_ORM namespace Models { - // NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) - class Phone final : public Orm::Tiny::Model + class Phone final : public Orm::Tiny::Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { using Model::Model; }; diff --git a/tests/models/models/album.hpp b/tests/models/models/album.hpp index 818728ae9..e43f64040 100644 --- a/tests/models/models/album.hpp +++ b/tests/models/models/album.hpp @@ -18,8 +18,7 @@ using Orm::Tiny::Model; class AlbumImage; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Album final : public Model +class Album final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/albumimage.hpp b/tests/models/models/albumimage.hpp index 15d6d430b..56a88182a 100644 --- a/tests/models/models/albumimage.hpp +++ b/tests/models/models/albumimage.hpp @@ -17,8 +17,7 @@ using Orm::Tiny::Model; class Album; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class AlbumImage final : public Model +class AlbumImage final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/datetime.hpp b/tests/models/models/datetime.hpp index 3e3692408..fb0f881f8 100644 --- a/tests/models/models/datetime.hpp +++ b/tests/models/models/datetime.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Datetime final : public Model +class Datetime final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/datetime_serializeoverride.hpp b/tests/models/models/datetime_serializeoverride.hpp index 8b3a783db..02b2acc2e 100644 --- a/tests/models/models/datetime_serializeoverride.hpp +++ b/tests/models/models/datetime_serializeoverride.hpp @@ -11,8 +11,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Datetime_SerializeOverride final : public Model +class Datetime_SerializeOverride final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/filepropertyproperty.hpp b/tests/models/models/filepropertyproperty.hpp index 173d61c31..e447449ff 100644 --- a/tests/models/models/filepropertyproperty.hpp +++ b/tests/models/models/filepropertyproperty.hpp @@ -13,8 +13,7 @@ using Orm::Tiny::Model; class TorrentPreviewableFileProperty; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class FilePropertyProperty final : +class FilePropertyProperty final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/massassignmentmodels.hpp b/tests/models/models/massassignmentmodels.hpp index 1f54858e2..1ea9c52fd 100644 --- a/tests/models/models/massassignmentmodels.hpp +++ b/tests/models/models/massassignmentmodels.hpp @@ -15,8 +15,7 @@ using Orm::Constants::SIZE_; using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Torrent_TotallyGuarded final : public Model +class Torrent_TotallyGuarded final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; @@ -25,8 +24,7 @@ class Torrent_TotallyGuarded final : public Model QString u_table {"torrents"}; }; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Torrent_GuardedAttribute final : public Model +class Torrent_GuardedAttribute final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; @@ -51,8 +49,7 @@ class Torrent_GuardedAttribute final : public Model }; }; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Torrent_AllowedMassAssignment final : +class Torrent_AllowedMassAssignment final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; @@ -65,8 +62,7 @@ class Torrent_AllowedMassAssignment final : inline static QStringList u_guarded {}; // disabled }; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Torrent_GuardableColumn final : +class Torrent_GuardableColumn final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/phone.hpp b/tests/models/models/phone.hpp index b474faab9..9e562be70 100644 --- a/tests/models/models/phone.hpp +++ b/tests/models/models/phone.hpp @@ -13,8 +13,7 @@ using Orm::Tiny::Model; class User; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Phone final : public Model +class Phone final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/role.hpp b/tests/models/models/role.hpp index 21f1dde21..44b04bb9f 100644 --- a/tests/models/models/role.hpp +++ b/tests/models/models/role.hpp @@ -18,8 +18,7 @@ using Orm::Tiny::Relations::Pivot; class User; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Role final : public Model +class Role final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/roleuser.hpp b/tests/models/models/roleuser.hpp index a5a52d6e5..97fdc6ef0 100644 --- a/tests/models/models/roleuser.hpp +++ b/tests/models/models/roleuser.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Relations::BasePivot; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class RoleUser final : public BasePivot +class RoleUser final : public BasePivot // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; friend BasePivot; diff --git a/tests/models/models/roleuser_appends.hpp b/tests/models/models/roleuser_appends.hpp index 1ca58938c..3bf404740 100644 --- a/tests/models/models/roleuser_appends.hpp +++ b/tests/models/models/roleuser_appends.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Relations::BasePivot; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class RoleUser_Appends final : public BasePivot +class RoleUser_Appends final : public BasePivot // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; friend BasePivot; diff --git a/tests/models/models/setting.hpp b/tests/models/models/setting.hpp index 9e610dd1c..188652ea7 100644 --- a/tests/models/models/setting.hpp +++ b/tests/models/models/setting.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Setting final : public Model +class Setting final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/tag.hpp b/tests/models/models/tag.hpp index ff42e6daa..8501b330d 100644 --- a/tests/models/models/tag.hpp +++ b/tests/models/models/tag.hpp @@ -21,8 +21,7 @@ using Orm::Tiny::Model; class Role; class Torrent; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Tag final : public Model +class Tag final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) //class Tag final : public Model { friend Model; diff --git a/tests/models/models/tag_returnrelation.hpp b/tests/models/models/tag_returnrelation.hpp index e6fd5d31c..c354d2f9a 100644 --- a/tests/models/models/tag_returnrelation.hpp +++ b/tests/models/models/tag_returnrelation.hpp @@ -14,8 +14,7 @@ using Orm::Tiny::Relations::Pivot; class Torrent_ReturnRelation; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Tag_ReturnRelation final : public Model { friend Model; diff --git a/tests/models/models/tagged.hpp b/tests/models/models/tagged.hpp index d09d96f7b..5b5db6a6c 100644 --- a/tests/models/models/tagged.hpp +++ b/tests/models/models/tagged.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Relations::BasePivot; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Tagged final : public BasePivot +class Tagged final : public BasePivot // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; friend BasePivot; diff --git a/tests/models/models/tagproperty.hpp b/tests/models/models/tagproperty.hpp index 93dbd303c..9febf392e 100644 --- a/tests/models/models/tagproperty.hpp +++ b/tests/models/models/tagproperty.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TagProperty final : public Model +class TagProperty final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrent.hpp b/tests/models/models/torrent.hpp index 57ab18681..11577f66b 100644 --- a/tests/models/models/torrent.hpp +++ b/tests/models/models/torrent.hpp @@ -48,8 +48,7 @@ class TorrentPreviewableFile; class TorrentState; class User; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class Torrent final : +class Torrent final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model // public Model { diff --git a/tests/models/models/torrenteager.hpp b/tests/models/models/torrenteager.hpp index 61848c281..70bd8a4b0 100644 --- a/tests/models/models/torrenteager.hpp +++ b/tests/models/models/torrenteager.hpp @@ -18,8 +18,7 @@ using Orm::Constants::SIZE_; using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentEager final : public Model { friend Model; diff --git a/tests/models/models/torrenteager_failed.hpp b/tests/models/models/torrenteager_failed.hpp index b39d0be0d..d6fd56ff6 100644 --- a/tests/models/models/torrenteager_failed.hpp +++ b/tests/models/models/torrenteager_failed.hpp @@ -11,8 +11,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentEager_Failed final : +class TorrentEager_Failed final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/torrenteager_withdefault.hpp b/tests/models/models/torrenteager_withdefault.hpp index 23fa83441..f6aa983f5 100644 --- a/tests/models/models/torrenteager_withdefault.hpp +++ b/tests/models/models/torrenteager_withdefault.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentEager_WithDefault final : public Model +class TorrentEager_WithDefault final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrenteager_without_qdatetime.hpp b/tests/models/models/torrenteager_without_qdatetime.hpp index a161b7dac..d5682d64f 100644 --- a/tests/models/models/torrenteager_without_qdatetime.hpp +++ b/tests/models/models/torrenteager_without_qdatetime.hpp @@ -15,8 +15,7 @@ using Orm::Constants::SIZE_; using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentEager_Without_QDateTime final : public Model +class TorrentEager_Without_QDateTime final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrentpeer.hpp b/tests/models/models/torrentpeer.hpp index 564146059..31bec05d4 100644 --- a/tests/models/models/torrentpeer.hpp +++ b/tests/models/models/torrentpeer.hpp @@ -13,8 +13,7 @@ using Orm::Tiny::Model; class Torrent; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class TorrentPeer final : public Model +class TorrentPeer final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrentpeereager.hpp b/tests/models/models/torrentpeereager.hpp index 4cfe4ab77..778de15f5 100644 --- a/tests/models/models/torrentpeereager.hpp +++ b/tests/models/models/torrentpeereager.hpp @@ -11,8 +11,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentPeerEager final : public Model +class TorrentPeerEager final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrentpeereager_norelations.hpp b/tests/models/models/torrentpeereager_norelations.hpp index bbf93005c..99bf81f98 100644 --- a/tests/models/models/torrentpeereager_norelations.hpp +++ b/tests/models/models/torrentpeereager_norelations.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentPeerEager_NoRelations final : public Model +class TorrentPeerEager_NoRelations final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/torrentpreviewablefile.hpp b/tests/models/models/torrentpreviewablefile.hpp index f19b1ba6c..33be4ca7e 100644 --- a/tests/models/models/torrentpreviewablefile.hpp +++ b/tests/models/models/torrentpreviewablefile.hpp @@ -22,8 +22,7 @@ using Orm::Tiny::Model; class Torrent; class TorrentPreviewableFileProperty; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class TorrentPreviewableFile final : +class TorrentPreviewableFile final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/torrentpreviewablefileeager.hpp b/tests/models/models/torrentpreviewablefileeager.hpp index ce34981c8..ab67ebb82 100644 --- a/tests/models/models/torrentpreviewablefileeager.hpp +++ b/tests/models/models/torrentpreviewablefileeager.hpp @@ -15,8 +15,7 @@ using Orm::Constants::SIZE_; using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentPreviewableFileEager final : +class TorrentPreviewableFileEager final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/torrentpreviewablefileeager_withdefault.hpp b/tests/models/models/torrentpreviewablefileeager_withdefault.hpp index 75275c3d4..082b6215b 100644 --- a/tests/models/models/torrentpreviewablefileeager_withdefault.hpp +++ b/tests/models/models/torrentpreviewablefileeager_withdefault.hpp @@ -17,8 +17,7 @@ using Orm::Constants::SIZE_; using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentPreviewableFileEager_WithDefault final : +class TorrentPreviewableFileEager_WithDefault final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { diff --git a/tests/models/models/torrentpreviewablefileproperty.hpp b/tests/models/models/torrentpreviewablefileproperty.hpp index 4477fa5b7..75bcfcae2 100644 --- a/tests/models/models/torrentpreviewablefileproperty.hpp +++ b/tests/models/models/torrentpreviewablefileproperty.hpp @@ -17,8 +17,7 @@ using Orm::Tiny::Model; class FilePropertyProperty; class TorrentPreviewableFile; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class TorrentPreviewableFileProperty final : +class TorrentPreviewableFileProperty final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { diff --git a/tests/models/models/torrentpreviewablefilepropertyeager.hpp b/tests/models/models/torrentpreviewablefilepropertyeager.hpp index 4df453e59..280c39ade 100644 --- a/tests/models/models/torrentpreviewablefilepropertyeager.hpp +++ b/tests/models/models/torrentpreviewablefilepropertyeager.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class TorrentPreviewableFilePropertyEager final : +class TorrentPreviewableFilePropertyEager final : // NOLINT(bugprone-exception-escape, misc-no-recursion) public Model { friend Model; diff --git a/tests/models/models/torrentstate.hpp b/tests/models/models/torrentstate.hpp index c9628c091..2169f523c 100644 --- a/tests/models/models/torrentstate.hpp +++ b/tests/models/models/torrentstate.hpp @@ -16,8 +16,7 @@ using Orm::Tiny::Relations::Pivot; class Torrent; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class TorrentState final : public Model +class TorrentState final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/type.hpp b/tests/models/models/type.hpp index a499bcb6f..2588ce82f 100644 --- a/tests/models/models/type.hpp +++ b/tests/models/models/type.hpp @@ -9,8 +9,7 @@ namespace Models using Orm::Tiny::Model; -// NOLINTNEXTLINE(bugprone-exception-escape) -class Type final : public Model +class Type final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) { friend Model; using Model::Model; diff --git a/tests/models/models/user.hpp b/tests/models/models/user.hpp index 9c5bd86e2..78c60d336 100644 --- a/tests/models/models/user.hpp +++ b/tests/models/models/user.hpp @@ -23,8 +23,7 @@ class Phone; class Role; class Torrent; -// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape) -class User final : public Model, +class User final : public Model, // NOLINT(bugprone-exception-escape, misc-no-recursion) public SoftDeletes { friend Model; diff --git a/tom/include/tom/tomtypes.hpp b/tom/include/tom/tomtypes.hpp index fbf2a4fbc..6f9d4d8e2 100644 --- a/tom/include/tom/tomtypes.hpp +++ b/tom/include/tom/tomtypes.hpp @@ -56,7 +56,7 @@ namespace Tom using Orm::Types::AboutValue; /*! Subsection item type. */ - struct SubSectionItem // NOLINT(bugprone-exception-escape) + struct SubSectionItem // NOLINT(bugprone-exception-escape, misc-no-recursion) { /*! Subsection item name. */ std::optional name;