diff --git a/.clang-tidy b/.clang-tidy index 5ee88a4..2592d8f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,20 +1,22 @@ --- Checks: '-*, bugprone-*, +clang-analyzer-*, cppcoreguidelines-*, google-*, -clang-analyzer-*, +llvm-*, misc-*, modernize-*, readability-*, performance-*, portability-*, -readability-identifier-naming, -cppcoreguidelines-owning-memory, -cppcoreguidelines-avoid-magic-numbers, +-cppcoreguidelines-pro-bounds-array-to-pointer-decay, -readability-magic-numbers, -readability-else-after-return, -modernize-use-trailing-return-type, +-modernize-avoid-c-arrays, -performance-no-automatic-move, ' @@ -32,9 +34,9 @@ CheckOptions: - key: readability-identifier-naming.ClassSuffix value: '' - key: readability-identifier-naming.ClassConstantCase - value: UPPER_CASE + value: CamelCase - key: readability-identifier-naming.ClassConstantPrefix - value: '' + value: 'k_' - key: readability-identifier-naming.ClassConstantSuffix value: '' - key: readability-identifier-naming.ClassMemberCase @@ -50,9 +52,9 @@ CheckOptions: - key: readability-identifier-naming.ClassMethodSuffix value: '' - key: readability-identifier-naming.ConstantCase - value: UPPER_CASE + value: CamelCase - key: readability-identifier-naming.ConstantPrefix - value: PRE + value: 'k_' - key: readability-identifier-naming.ConstantSuffix value: POST - key: readability-identifier-naming.ConstantMemberCase @@ -98,9 +100,9 @@ CheckOptions: - key: readability-identifier-naming.EnumSuffix value: '' - key: readability-identifier-naming.EnumConstantCase - value: UPPER_CASE + value: CamelCase - key: readability-identifier-naming.EnumConstantPrefix - value: '' + value: 'k_' - key: readability-identifier-naming.EnumConstantSuffix value: '' - key: readability-identifier-naming.FunctionCase @@ -110,9 +112,9 @@ CheckOptions: - key: readability-identifier-naming.FunctionSuffix value: '' - key: readability-identifier-naming.GlobalConstantCase - value: UPPER_CASE + value: CamelCase - key: readability-identifier-naming.GlobalConstantPrefix - value: '' + value: 'k_' - key: readability-identifier-naming.GlobalConstantSuffix value: '' - key: readability-identifier-naming.GlobalConstantPointerCase @@ -148,7 +150,7 @@ CheckOptions: - key: readability-identifier-naming.LocalConstantCase value: camelBack - key: readability-identifier-naming.LocalConstantPrefix - value: '' + value: 'k_' - key: readability-identifier-naming.LocalConstantSuffix value: '' - key: readability-identifier-naming.LocalConstantPointerCase @@ -244,7 +246,7 @@ CheckOptions: - key: readability-identifier-naming.StaticConstantCase value: camelBack - key: readability-identifier-naming.StaticConstantPrefix - value: '' + value: 'k_' - key: readability-identifier-naming.StaticConstantSuffix value: '' - key: readability-identifier-naming.StaticVariableCase diff --git a/examples/filesystem/01_minimal/minimal.cpp b/examples/filesystem/01_minimal/minimal.cpp index de3ba58..ecf7490 100644 --- a/examples/filesystem/01_minimal/minimal.cpp +++ b/examples/filesystem/01_minimal/minimal.cpp @@ -9,8 +9,8 @@ namespace MF = myx::filesystem; // Переменные для защиты экземпляра класса MF::Paths -std::atomic< MF::Paths* > MF::Paths::m_instance; -std::mutex MF::Paths::m_mutex; +std::atomic< MF::Paths* > MF::Paths::mInstance; +std::mutex MF::Paths::mMutex; int main( int argc, char** argv ) { diff --git a/src/myx/filesystem/current_executable.cpp b/src/myx/filesystem/current_executable.cpp index 7664499..c94a0c2 100644 --- a/src/myx/filesystem/current_executable.cpp +++ b/src/myx/filesystem/current_executable.cpp @@ -2,8 +2,9 @@ #include #include -#include + #include +#include namespace myx { diff --git a/src/myx/filesystem/paths.cpp b/src/myx/filesystem/paths.cpp index 4b409f1..f014665 100644 --- a/src/myx/filesystem/paths.cpp +++ b/src/myx/filesystem/paths.cpp @@ -3,17 +3,15 @@ #include #include -#include + #include +#include namespace myx { namespace filesystem { -Paths::Paths() -{ -} - +Paths::Paths() = default; Paths::HierarchyType Paths::getHierarchyType() { diff --git a/src/myx/filesystem/paths.hpp b/src/myx/filesystem/paths.hpp index 4a374a2..697216d 100644 --- a/src/myx/filesystem/paths.hpp +++ b/src/myx/filesystem/paths.hpp @@ -83,8 +83,8 @@ class Paths HierarchyType getHierarchyType(); - static std::atomic< Paths* > m_instance; - static std::mutex m_mutex; + static std::atomic< Paths* > mInstance; + static std::mutex mMutex; public: /** @@ -93,15 +93,15 @@ public: */ static Paths* getInstance() { - Paths* localInstance = m_instance.load( std::memory_order_acquire ); + Paths* localInstance = mInstance.load( std::memory_order_acquire ); if ( !localInstance ) { - std::lock_guard< std::mutex > myLock( m_mutex ); - localInstance = m_instance.load( std::memory_order_relaxed ); + std::lock_guard< std::mutex > myLock( mMutex ); + localInstance = mInstance.load( std::memory_order_relaxed ); if ( !localInstance ) { localInstance = new Paths(); - m_instance.store( localInstance, std::memory_order_release ); + mInstance.store( localInstance, std::memory_order_release ); } } return( localInstance ); diff --git a/src/myx/math/almost_equal_ulps.cpp b/src/myx/math/almost_equal_ulps.cpp index e62f76a..93223d7 100644 --- a/src/myx/math/almost_equal_ulps.cpp +++ b/src/myx/math/almost_equal_ulps.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include diff --git a/src/myx/math/almost_equal_ulps_and_abs.cpp b/src/myx/math/almost_equal_ulps_and_abs.cpp index 3c82970..1a725bb 100644 --- a/src/myx/math/almost_equal_ulps_and_abs.cpp +++ b/src/myx/math/almost_equal_ulps_and_abs.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include diff --git a/src/myx/qt/translators.cpp b/src/myx/qt/translators.cpp index 111e2a1..771fe42 100644 --- a/src/myx/qt/translators.cpp +++ b/src/myx/qt/translators.cpp @@ -1,9 +1,10 @@ -#include #include "translators.hpp" +#include + #include -#include #include +#include namespace myx {