diff --git a/.clang-tidy b/.clang-tidy index 7b14b0a..c8c0ac7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -16,7 +16,6 @@ portability-*, -llvm-header-guard, -readability-magic-numbers, -readability-else-after-return, --readability-identifier-naming, -modernize-use-trailing-return-type, -modernize-avoid-c-arrays, -performance-no-automatic-move, @@ -90,9 +89,9 @@ CheckOptions: - key: readability-identifier-naming.ConstexprMethodSuffix value: '' - key: readability-identifier-naming.ConstexprVariableCase - value: lower_case + value: CamelCase - key: readability-identifier-naming.ConstexprVariablePrefix - value: '' + value: 'k_' - key: readability-identifier-naming.ConstexprVariableSuffix value: '' - key: readability-identifier-naming.EnumCase @@ -104,7 +103,7 @@ CheckOptions: - key: readability-identifier-naming.EnumConstantCase value: CamelCase - key: readability-identifier-naming.EnumConstantPrefix - value: 'k_' + value: 'k' - key: readability-identifier-naming.EnumConstantSuffix value: '' - key: readability-identifier-naming.FunctionCase @@ -116,7 +115,7 @@ CheckOptions: - key: readability-identifier-naming.GlobalConstantCase value: CamelCase - key: readability-identifier-naming.GlobalConstantPrefix - value: 'k_' + value: '' - key: readability-identifier-naming.GlobalConstantSuffix value: '' - key: readability-identifier-naming.GlobalConstantPointerCase diff --git a/src/myx/base/enum_bitmask_operations.hpp b/src/myx/base/enum_bitmask_operations.hpp index a93094d..896a952 100644 --- a/src/myx/base/enum_bitmask_operations.hpp +++ b/src/myx/base/enum_bitmask_operations.hpp @@ -13,17 +13,17 @@ namespace base { template< typename Enum > struct EnableBitMaskOperators { - static const bool enable = false; + static const bool k_Enable = false; }; template< typename Enum > -typename std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type +typename std::enable_if< EnableBitMaskOperators< Enum >::k_Enable, Enum >::type operator |( Enum lhs, Enum rhs ) { - using underlying = typename std::underlying_type< Enum >::type; + using Underlying = typename std::underlying_type< Enum >::type; return( static_cast< Enum >( - static_cast< underlying >( lhs ) | - static_cast< underlying >( rhs ) + static_cast< Underlying >( lhs ) | + static_cast< Underlying >( rhs ) ) ); } @@ -52,7 +52,7 @@ operator |( Enum lhs, Enum rhs ) template<> \ struct myx::base::EnableBitMaskOperators< x > \ { \ - static const bool enable = true; \ + static const bool k_Enable = true; \ }; #endif // ifndef MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_ diff --git a/src/myx/math/almost_equal_ulps.cpp b/src/myx/math/almost_equal_ulps.cpp index 93223d7..9beb2d6 100644 --- a/src/myx/math/almost_equal_ulps.cpp +++ b/src/myx/math/almost_equal_ulps.cpp @@ -10,8 +10,8 @@ namespace math { bool almost_equal_ulps( const float a, const float b, const int maxUlpsDiff ) { - float_cmp_t uA( a ); - float_cmp_t uB( b ); + FloatCmp uA( a ); + FloatCmp uB( b ); // Если знаки разные, то числа не равны. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) @@ -46,8 +46,8 @@ bool almost_equal_ulps( const float a, const float b, bool almost_equal_ulps( const double a, const double b, const int maxUlpsDiff ) { - double_cmp_t uA( a ); - double_cmp_t uB( b ); + DoubleCmp uA( a ); + DoubleCmp uB( b ); // Если знаки разные, то числа не равны. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) diff --git a/src/myx/math/almost_equal_ulps_and_abs.cpp b/src/myx/math/almost_equal_ulps_and_abs.cpp index 1a725bb..09c98f6 100644 --- a/src/myx/math/almost_equal_ulps_and_abs.cpp +++ b/src/myx/math/almost_equal_ulps_and_abs.cpp @@ -18,8 +18,8 @@ bool almost_equal_ulps_and_abs( const float a, const float b, return( true ); } - float_cmp_t uA( a ); - float_cmp_t uB( b ); + FloatCmp uA( a ); + FloatCmp uB( b ); // Different signs means they do not match. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) @@ -51,8 +51,8 @@ bool almost_equal_ulps_and_abs( const double a, const double b, return( true ); } - double_cmp_t uA( a ); - double_cmp_t uB( b ); + DoubleCmp uA( a ); + DoubleCmp uB( b ); // Different signs means they do not match. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access) diff --git a/src/myx/math/float_cmp_types.hpp b/src/myx/math/float_cmp_types.hpp index 309231f..b24d9ea 100644 --- a/src/myx/math/float_cmp_types.hpp +++ b/src/myx/math/float_cmp_types.hpp @@ -6,7 +6,7 @@ /** * @brief Объединение для получения знака аргумента типа float. */ -union float_cmp_t +union FloatCmp { int32_t i; float f; @@ -14,7 +14,7 @@ union float_cmp_t /** * @brief Инициализация. */ - explicit float_cmp_t( float num = 0.0F ) : f( num ) + explicit FloatCmp( float num = 0.0F ) : f( num ) { } @@ -30,7 +30,7 @@ union float_cmp_t /** * @brief Объединение для получения знака аргумента типа double. */ -union double_cmp_t +union DoubleCmp { int64_t i; double d; @@ -38,7 +38,7 @@ union double_cmp_t /** * @brief Инициализация. */ - explicit double_cmp_t( double num = 0.0L ) : d( num ) + explicit DoubleCmp( double num = 0.0L ) : d( num ) { } diff --git a/src/myx/qt/translators.hpp b/src/myx/qt/translators.hpp index 17ac217..8d40cb0 100644 --- a/src/myx/qt/translators.hpp +++ b/src/myx/qt/translators.hpp @@ -9,7 +9,7 @@ namespace myx { namespace qt { -typedef QList< QTranslator* > QTranslatorsList; +using QTranslatorsList = QList< QTranslator* >; void append_translators( QTranslatorsList& translators, const QString& appName ); // NOLINT