diff --git a/.clang-tidy b/.clang-tidy index 9943fb0..4534983 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '-*,bugprone-*,cppcoreguidelines-*,google-*,clang-analyzer-*,misc-*,modernize-*,readability-*,performance-*,portability-*,readability-identifier-naming,-cppcoreguidelines-owning-memory' +Checks: '-*,bugprone-*,cppcoreguidelines-*,google-*,clang-analyzer-*,misc-*,modernize-*,readability-*,performance-*,portability-*,readability-identifier-naming,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type' CheckOptions: - key: readability-identifier-naming.AbstractClassCase value: CamelCase diff --git a/src/myx/filesystem/paths.cpp b/src/myx/filesystem/paths.cpp index 01b1a36..9542781 100644 --- a/src/myx/filesystem/paths.cpp +++ b/src/myx/filesystem/paths.cpp @@ -59,12 +59,11 @@ void Paths::setLogDirectory( const QString& logDirectory ) } -Paths::Paths( const QString& configFileExtension ) : - m_configFileExtension( configFileExtension ) - +Paths::Paths( QString configFileExtension ) : + m_prefixDirectory ( "/opt/" + QCoreApplication::organizationName().toLower() + + "/" + QCoreApplication::applicationName().toLower() ), + m_configFileExtension( std::move( configFileExtension ) ) { - m_prefixDirectory = "/opt/" + QCoreApplication::organizationName().toLower() + - "/" + QCoreApplication::applicationName().toLower(); auto pd = m_prefixDirectory.absolutePath(); m_binaryDirectory = pd + "/bin"; m_configDirectory = pd + "/etc"; diff --git a/src/myx/filesystem/paths.hpp b/src/myx/filesystem/paths.hpp index 2046f34..b8cab34 100644 --- a/src/myx/filesystem/paths.hpp +++ b/src/myx/filesystem/paths.hpp @@ -49,7 +49,7 @@ public: * @brief Конструктор * @param configFileExtension Расширение для файла настройки */ - Paths( const QString& configFileExtension = "conf" ); + Paths( QString configFileExtension = "conf" ); /** * @brief Получение пути к базовому каталогу */ diff --git a/src/myx/math/almost_equal_ulps.cpp b/src/myx/math/almost_equal_ulps.cpp index 3149dba..4c0e8a8 100644 --- a/src/myx/math/almost_equal_ulps.cpp +++ b/src/myx/math/almost_equal_ulps.cpp @@ -14,6 +14,7 @@ bool almost_equal_ulps( const float a, const float b, float_cmp_t uB( b ); // Если знаки разные, то числа не равны. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if ( uA.negative() != uB.negative() ) { // Кроме случая, когда +0==-0 @@ -32,6 +33,7 @@ bool almost_equal_ulps( const float a, const float b, } // Разница в младших битах. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) auto ulpsDiff = std::abs( uA.i - uB.i ); if ( ulpsDiff <= maxUlpsDiff ) { @@ -48,6 +50,7 @@ bool almost_equal_ulps( const double a, const double b, double_cmp_t uB( b ); // Если знаки разные, то числа не равны. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if ( uA.negative() != uB.negative() ) { // Кроме случая, когда +0==-0 @@ -66,6 +69,7 @@ bool almost_equal_ulps( const double a, const double b, } // Разница в младших битах. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) auto ulpsDiff = std::abs( uA.i - uB.i ); if ( ulpsDiff <= maxUlpsDiff ) { diff --git a/src/myx/math/almost_equal_ulps_and_abs.cpp b/src/myx/math/almost_equal_ulps_and_abs.cpp index d1f3f7c..3c82970 100644 --- a/src/myx/math/almost_equal_ulps_and_abs.cpp +++ b/src/myx/math/almost_equal_ulps_and_abs.cpp @@ -22,12 +22,14 @@ bool almost_equal_ulps_and_abs( const float a, const float b, float_cmp_t uB( b ); // Different signs means they do not match. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if ( uA.negative() != uB.negative() ) { return( false ); } // Find the difference in ULPs. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) int ulpsDiff = std::abs( uA.i - uB.i ); if ( ulpsDiff <= maxUlpsDiff ) { @@ -53,12 +55,14 @@ bool almost_equal_ulps_and_abs( const double a, const double b, double_cmp_t uB( b ); // Different signs means they do not match. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) if ( uA.negative() != uB.negative() ) { return( false ); } // Find the difference in ULPs. + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) auto ulpsDiff = std::abs( uA.i - uB.i ); if ( ulpsDiff <= maxUlpsDiff ) { diff --git a/src/myx/qt/translators.cpp b/src/myx/qt/translators.cpp index 39cf4a8..111e2a1 100644 --- a/src/myx/qt/translators.cpp +++ b/src/myx/qt/translators.cpp @@ -13,8 +13,8 @@ void append_translators( QTranslatorsList& translators, const QString& appName ) { auto* translator = new QTranslator( qApp ); - if ( translator->load( QLocale(), appName, QStringLiteral( "_" ), - QStringLiteral( ":/qm" ) ) ) + if ( translator->load( QLocale(), + appName, QStringLiteral( "_" ), QStringLiteral( ":/qm" ) ) ) { translators.append( translator ); } @@ -50,7 +50,7 @@ void append_translators( QTranslatorsList& translators, const QString& appName ) { qApp->installTranslator( i ); } -} // install_translators +} // append_translators } // namespace qt