From a0ee556c898468e2ff5187399e3fd9451485874b Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 29 Dec 2021 14:14:59 -0700 Subject: [PATCH] Reintroduce readability-redundant-member-init and modernize-use-bool-literals checks and fix. (#534) --- .clang-tidy | 2 +- amr-wind/CFDSim.cpp | 1 - amr-wind/physics/udfs/LinearProfile.cpp | 2 +- amr-wind/physics/udfs/PowerLawProfile.cpp | 2 +- amr-wind/utilities/diagnostics.cpp | 10 +++++----- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index f88f27ffd7..b5adac33e7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,corecppguidelines-*,modernize-*,readability-*,-readability-magic-numbers,-readability-identifier-naming,-modernize-avoid-c-arrays,-modernize-use-trailing-return-type,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-isolate-declaration,-readability-braces-around-statements,-readability-inconsistent-declaration-parameter-name,-modernize-use-emplace,-readability-qualified-auto,-readability-static-accessed-through-instance,-readability-container-size-empty,-readability-make-member-function-const,-readability-uppercase-literal-suffix,-readability-convert-member-functions-to-static,-readability-redundant-member-init,-modernize-use-bool-literals,-modernize-pass-by-value,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.NonNullParamChecker' +Checks: 'clang-diagnostic-*,clang-analyzer-*,corecppguidelines-*,modernize-*,readability-*,-readability-magic-numbers,-readability-identifier-naming,-modernize-avoid-c-arrays,-modernize-use-trailing-return-type,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-isolate-declaration,-readability-braces-around-statements,-readability-inconsistent-declaration-parameter-name,-modernize-use-emplace,-readability-qualified-auto,-readability-static-accessed-through-instance,-readability-container-size-empty,-readability-make-member-function-const,-readability-uppercase-literal-suffix,-readability-convert-member-functions-to-static,-modernize-pass-by-value,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.NonNullParamChecker' WarningsAsErrors: '' HeaderFilterRegex: '^((?!/amrex/Src/|/googletest/).)*$' AnalyzeTemporaryDtors: false diff --git a/amr-wind/CFDSim.cpp b/amr-wind/CFDSim.cpp index ba727d2e17..0830ebe8e6 100644 --- a/amr-wind/CFDSim.cpp +++ b/amr-wind/CFDSim.cpp @@ -11,7 +11,6 @@ namespace amr_wind { CFDSim::CFDSim(amrex::AmrCore& mesh) : m_mesh(mesh) - , m_time() , m_repo(m_mesh) , m_pde_mgr(*this) , m_io_mgr(new IOManager(*this)) diff --git a/amr-wind/physics/udfs/LinearProfile.cpp b/amr-wind/physics/udfs/LinearProfile.cpp index 192fd40b60..0d3bb48cb4 100644 --- a/amr-wind/physics/udfs/LinearProfile.cpp +++ b/amr-wind/physics/udfs/LinearProfile.cpp @@ -7,7 +7,7 @@ namespace amr_wind { namespace udf { -LinearProfile::LinearProfile(const Field& fld) : m_op() +LinearProfile::LinearProfile(const Field& fld) { amrex::ParmParse pp("LinearProfile." + fld.name()); diff --git a/amr-wind/physics/udfs/PowerLawProfile.cpp b/amr-wind/physics/udfs/PowerLawProfile.cpp index 17b696047d..7303ae116b 100644 --- a/amr-wind/physics/udfs/PowerLawProfile.cpp +++ b/amr-wind/physics/udfs/PowerLawProfile.cpp @@ -9,7 +9,7 @@ namespace amr_wind { namespace udf { -PowerLawProfile::PowerLawProfile(const Field& fld) : m_op() +PowerLawProfile::PowerLawProfile(const Field& fld) { AMREX_ALWAYS_ASSERT(fld.name() == pde::ICNS::var_name()); AMREX_ALWAYS_ASSERT(fld.num_comp() == AMREX_SPACEDIM); diff --git a/amr-wind/utilities/diagnostics.cpp b/amr-wind/utilities/diagnostics.cpp index 979dccb634..0299b0fc00 100644 --- a/amr-wind/utilities/diagnostics.cpp +++ b/amr-wind/utilities/diagnostics.cpp @@ -71,11 +71,11 @@ void incflo::PrintMaxGp(int lev) void incflo::CheckForNans(int lev) { BL_PROFILE("amr-wind::incflo::CheckForNans"); - bool ro_has_nans = density()(lev).contains_nan(0); - bool ug_has_nans = velocity()(lev).contains_nan(0); - bool vg_has_nans = velocity()(lev).contains_nan(1); - bool wg_has_nans = velocity()(lev).contains_nan(2); - bool pg_has_nans = pressure()(lev).contains_nan(0); + bool ro_has_nans = density()(lev).contains_nan(false); + bool ug_has_nans = velocity()(lev).contains_nan(false); + bool vg_has_nans = velocity()(lev).contains_nan(true); + bool wg_has_nans = velocity()(lev).contains_nan(true); + bool pg_has_nans = pressure()(lev).contains_nan(false); if (ro_has_nans) amrex::Print() << "WARNING: ro contains NaNs!!!";