diff --git a/.clang-tidy b/.clang-tidy index 3932fd58cded36dec5d3a1953a63bb3bf975ec18..e28390b5b3793f360dafd67356ae2b6e793e303a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -67,6 +67,7 @@ Checks: '*, -cppcoreguidelines-avoid-non-const-global-variables, -llvm-include-order, -readability-redundant-access-specifiers, +-*special-member-functions, -SectionComment_Resolving_the_following_checks_would_be_too_much_work_right_now, @@ -81,11 +82,13 @@ Checks: '*, -bugprone-parent-virtual-call, -clang-analyzer-core.CallAndMessage, -clang-analyzer-optin.cplusplus.VirtualCall, +-hicpp-member-init, -modernize-loop-convert, -modernize-pass-by-value, -modernize-use-using, --special-member-functions, +-misc-non-private-member-variables-in-classes, -SectionComment_Temporarily_disabled_checks__We_need_to_investigate_them_one_by_one, + ' diff --git a/Base/Util/PyFmt.cpp b/Base/Util/PyFmt.cpp index 967cc670c0e9855e859cb70a819e9653c60a6e7b..2fc6defad0a2f6822808c262f013b9e93d547c2e 100644 --- a/Base/Util/PyFmt.cpp +++ b/Base/Util/PyFmt.cpp @@ -126,7 +126,7 @@ std::string printValue(double value, const std::string& units) return printDegrees(value); if (units == "nm") return printNm(value); - if (units == "") + if (units.empty()) return printDouble(value); ASSERT(0); } diff --git a/GUI/Model/Group/GroupInfo.cpp b/GUI/Model/Group/GroupInfo.cpp index 3076902f7a34b74b35e601ccd6a30641342babc8..c85e69efdd82f18d59a68ce2061cc6ba3c2c63b7 100644 --- a/GUI/Model/Group/GroupInfo.cpp +++ b/GUI/Model/Group/GroupInfo.cpp @@ -48,7 +48,7 @@ void GroupInfo::add(const QString& itemType) QString GroupInfo::defaultType() const { - if (m_defaultItemType == "" && m_info.size() != 0) + if (m_defaultItemType.empty() && !m_info.empty()) return m_info[0].m_itemType; return m_defaultItemType; } diff --git a/GUI/Model/Job/JobItemUtils.cpp b/GUI/Model/Job/JobItemUtils.cpp index 16ef5bd19dc12d9391a41ee7b1ded119c849c30c..2c109e4132708f4d5a8f924551092f81e8274806 100644 --- a/GUI/Model/Job/JobItemUtils.cpp +++ b/GUI/Model/Job/JobItemUtils.cpp @@ -134,7 +134,7 @@ ComboProperty GUI::Model::JobItemUtils::availableUnits(const ICoordSystem& conve ComboProperty result; for (auto units : converter.availableUnits()) { auto unit_name = nameFromCoords(units); - if (unit_name != "") + if (!unit_name.empty()) result << unit_name; } diff --git a/Tests/Functional/Core/Consistence/CompareTwoReferences.cpp b/Tests/Functional/Core/Consistence/CompareTwoReferences.cpp index 5e7ef5028d3443f7a7c1f8a611f07dd350789809..dabbe0780718a9eb4865492e74b99cace130b51b 100644 --- a/Tests/Functional/Core/Consistence/CompareTwoReferences.cpp +++ b/Tests/Functional/Core/Consistence/CompareTwoReferences.cpp @@ -22,7 +22,7 @@ namespace { std::unique_ptr<OutputData<double>> load(const std::string& name) { - ASSERT(name != ""); + ASSERT(!name.empty()); const std::string path = BaseUtils::Filesystem::jointPath(BATesting::ReferenceDir_Std(), name + ".int.gz"); std::unique_ptr<OutputData<double>> data; diff --git a/Tests/Functional/Core/Std/Check.cpp b/Tests/Functional/Core/Std/Check.cpp index 8b9fac9494c9e0bd055714f5af78f1c07fc303a5..59e83a18a034dc893884e853bba361cc94f26a44 100644 --- a/Tests/Functional/Core/Std/Check.cpp +++ b/Tests/Functional/Core/Std/Check.cpp @@ -32,7 +32,7 @@ bool checkSimulation(const std::string& name, const ISimulation& direct_simulati std::unique_ptr<OutputData<double>> reference; // Load reference if available. - ASSERT(name != ""); + ASSERT(!name.empty()); try { const std::string refPath = BaseUtils::Filesystem::jointPath(BATesting::ReferenceDir_Std(), name + ".int.gz");