Skip to content

Commit

Permalink
revisited bugprone-exception-escape
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed May 3, 2024
1 parent 882ad5e commit 22e87b5
Show file tree
Hide file tree
Showing 36 changed files with 38 additions and 76 deletions.
1 change: 0 additions & 1 deletion include/orm/tiny/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/auto/functional/orm/tiny/model/tst_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Role_WithoutUDates>
class Role_WithoutUDates final : public Model<Role_WithoutUDates> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/database/seeders/phoneseeder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#ifndef TINYORM_DISABLE_ORM
namespace Models
{
// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Phone final : public Orm::Tiny::Model<Phone>
class Phone final : public Orm::Tiny::Model<Phone> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
using Model::Model;
};
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/album.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ using Orm::Tiny::Model;

class AlbumImage;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Album final : public Model<Album, AlbumImage>
class Album final : public Model<Album, AlbumImage> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/albumimage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ using Orm::Tiny::Model;

class Album;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class AlbumImage final : public Model<AlbumImage, Album>
class AlbumImage final : public Model<AlbumImage, Album> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Datetime final : public Model<Datetime>
class Datetime final : public Model<Datetime> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/datetime_serializeoverride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Datetime_SerializeOverride final : public Model<Datetime_SerializeOverride>
class Datetime_SerializeOverride final : public Model<Datetime_SerializeOverride> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/filepropertyproperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FilePropertyProperty, TorrentPreviewableFileProperty>
{
friend Model;
Expand Down
12 changes: 4 additions & 8 deletions tests/models/models/massassignmentmodels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ using Orm::Constants::SIZE_;

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Torrent_TotallyGuarded final : public Model<Torrent_TotallyGuarded>
class Torrent_TotallyGuarded final : public Model<Torrent_TotallyGuarded> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand All @@ -25,8 +24,7 @@ class Torrent_TotallyGuarded final : public Model<Torrent_TotallyGuarded>
QString u_table {"torrents"};
};

// NOLINTNEXTLINE(bugprone-exception-escape)
class Torrent_GuardedAttribute final : public Model<Torrent_GuardedAttribute>
class Torrent_GuardedAttribute final : public Model<Torrent_GuardedAttribute> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand All @@ -51,8 +49,7 @@ class Torrent_GuardedAttribute final : public Model<Torrent_GuardedAttribute>
};
};

// NOLINTNEXTLINE(bugprone-exception-escape)
class Torrent_AllowedMassAssignment final :
class Torrent_AllowedMassAssignment final : // NOLINT(bugprone-exception-escape, misc-no-recursion)
public Model<Torrent_AllowedMassAssignment>
{
friend Model;
Expand All @@ -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<Torrent_GuardableColumn>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/phone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ using Orm::Tiny::Model;

class User;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Phone final : public Model<Phone, User>
class Phone final : public Model<Phone, User> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/role.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ using Orm::Tiny::Relations::Pivot;

class User;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Role final : public Model<Role, User, RoleUser, RoleUser_Appends, Pivot>
class Role final : public Model<Role, User, RoleUser, RoleUser_Appends, Pivot> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/roleuser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Relations::BasePivot;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class RoleUser final : public BasePivot<RoleUser>
class RoleUser final : public BasePivot<RoleUser> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
friend BasePivot;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/roleuser_appends.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Relations::BasePivot;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class RoleUser_Appends final : public BasePivot<RoleUser_Appends>
class RoleUser_Appends final : public BasePivot<RoleUser_Appends> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
friend BasePivot;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/setting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Setting final : public Model<Setting>
class Setting final : public Model<Setting> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ using Orm::Tiny::Model;
class Role;
class Torrent;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Tag final : public Model<Tag, Torrent, TagProperty, Role, Tagged>
class Tag final : public Model<Tag, Torrent, TagProperty, Role, Tagged> // NOLINT(bugprone-exception-escape, misc-no-recursion)
//class Tag final : public Model<Tag, Torrent, TagProperty, Role, Pivot>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/tag_returnrelation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Tag_ReturnRelation, Torrent_ReturnRelation,
class Tag_ReturnRelation final : public Model<Tag_ReturnRelation, Torrent_ReturnRelation, // NOLINT(bugprone-exception-escape, misc-no-recursion)
Pivot>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/tagged.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Relations::BasePivot;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Tagged final : public BasePivot<Tagged>
class Tagged final : public BasePivot<Tagged> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
friend BasePivot;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/tagproperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TagProperty final : public Model<TagProperty>
class TagProperty final : public Model<TagProperty> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Torrent, TorrentPreviewableFile, TorrentPeer, Tag, User,
TorrentState, Pivot>
// public Model<Torrent, TorrentPreviewableFile, TorrentPeer, Tag, User,
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrent_returnrelation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class TorrentPeer;
class TorrentPreviewableFile;
class User;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class Torrent_ReturnRelation final :
class Torrent_ReturnRelation final : // NOLINT(bugprone-exception-escape, misc-no-recursion)
public Model<Torrent_ReturnRelation, TorrentPreviewableFile, TorrentPeer, Tag,
Tag_ReturnRelation, User, Pivot>
{
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrenteager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ using Orm::Constants::SIZE_;

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TorrentEager final : public Model<TorrentEager, TorrentPreviewableFileEager,
class TorrentEager final : public Model<TorrentEager, TorrentPreviewableFileEager, // NOLINT(bugprone-exception-escape, misc-no-recursion)
TorrentPeerEager_NoRelations>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrenteager_failed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentEager_Failed, TorrentPreviewableFileEager>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrenteager_withdefault.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TorrentEager_WithDefault final : public Model<TorrentEager_WithDefault>
class TorrentEager_WithDefault final : public Model<TorrentEager_WithDefault> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrenteager_without_qdatetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ using Orm::Constants::SIZE_;

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TorrentEager_Without_QDateTime final : public Model<TorrentEager_Without_QDateTime>
class TorrentEager_Without_QDateTime final : public Model<TorrentEager_Without_QDateTime> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpeer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ using Orm::Tiny::Model;

class Torrent;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class TorrentPeer final : public Model<TorrentPeer, Torrent>
class TorrentPeer final : public Model<TorrentPeer, Torrent> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpeereager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TorrentPeerEager final : public Model<TorrentPeerEager, TorrentEager>
class TorrentPeerEager final : public Model<TorrentPeerEager, TorrentEager> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpeereager_norelations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class TorrentPeerEager_NoRelations final : public Model<TorrentPeerEager_NoRelations>
class TorrentPeerEager_NoRelations final : public Model<TorrentPeerEager_NoRelations> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpreviewablefile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentPreviewableFile, Torrent, TorrentPreviewableFileProperty>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpreviewablefileeager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentPreviewableFileEager, TorrentPreviewableFilePropertyEager>
{
friend Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentPreviewableFileEager_WithDefault, TorrentEager_WithDefault,
TorrentPreviewableFilePropertyEager>
{
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpreviewablefileproperty.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentPreviewableFileProperty, TorrentPreviewableFile,
FilePropertyProperty>
{
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentpreviewablefilepropertyeager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TorrentPreviewableFilePropertyEager>
{
friend Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/torrentstate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ using Orm::Tiny::Relations::Pivot;

class Torrent;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class TorrentState final : public Model<TorrentState, Pivot>
class TorrentState final : public Model<TorrentState, Pivot> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Models

using Orm::Tiny::Model;

// NOLINTNEXTLINE(bugprone-exception-escape)
class Type final : public Model<Type>
class Type final : public Model<Type> // NOLINT(bugprone-exception-escape, misc-no-recursion)
{
friend Model;
using Model::Model;
Expand Down
3 changes: 1 addition & 2 deletions tests/models/models/user.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class Phone;
class Role;
class Torrent;

// NOLINTNEXTLINE(misc-no-recursion, bugprone-exception-escape)
class User final : public Model<User, Phone, Role, Torrent, Pivot>,
class User final : public Model<User, Phone, Role, Torrent, Pivot>, // NOLINT(bugprone-exception-escape, misc-no-recursion)
public SoftDeletes<User>
{
friend Model;
Expand Down
2 changes: 1 addition & 1 deletion tom/include/tom/tomtypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString> name;
Expand Down

0 comments on commit 22e87b5

Please sign in to comment.