From: Artem Zhmurov Date: Mon, 26 Apr 2021 07:24:27 +0000 (+0000) Subject: Clang-11 fixes for applied forces X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=f86919ebfba5ee507799f918c709a66576cedf03;p=alexxy%2Fgromacs.git Clang-11 fixes for applied forces --- diff --git a/src/gromacs/applied_forces/awh/awh.cpp b/src/gromacs/applied_forces/awh/awh.cpp index 6f2a8db5ea..de3ebea891 100644 --- a/src/gromacs/applied_forces/awh/awh.cpp +++ b/src/gromacs/applied_forces/awh/awh.cpp @@ -116,14 +116,10 @@ struct BiasCoupledToSystem */ static bool anyDimUsesPull(const AwhBiasParams& awhBiasParams) { - for (const auto& awhDimParam : awhBiasParams.dimParams()) - { - if (awhDimParam.coordinateProvider() == AwhCoordinateProviderType::Pull) - { - return true; - } - } - return false; + return std::any_of( + awhBiasParams.dimParams().begin(), awhBiasParams.dimParams().end(), [](const auto& awhDimParam) { + return awhDimParam.coordinateProvider() == AwhCoordinateProviderType::Pull; + }); } /*! \brief Checks whether any dimension uses pulling as a coordinate provider. @@ -133,14 +129,9 @@ static bool anyDimUsesPull(const AwhBiasParams& awhBiasParams) */ static bool anyDimUsesPull(const AwhParams& awhParams) { - for (const auto& awhBiasParam : awhParams.awhBiasParams()) - { - if (anyDimUsesPull(awhBiasParam)) - { - return true; - } - } - return false; + return std::any_of(awhParams.awhBiasParams().begin(), + awhParams.awhBiasParams().end(), + [](const auto& awhBiasParam) { return anyDimUsesPull(awhBiasParam); }); } /*! \brief Checks whether any dimension uses pulling as a coordinate provider. @@ -150,14 +141,9 @@ static bool anyDimUsesPull(const AwhParams& awhParams) */ static bool anyDimUsesPull(const ArrayRef biasCoupledToSystem) { - for (const auto& biasCts : biasCoupledToSystem) - { - if (!biasCts.pullCoordIndex_.empty()) - { - return true; - } - } - return false; + return std::any_of(biasCoupledToSystem.begin(), biasCoupledToSystem.end(), [](const auto& biasCts) { + return !biasCts.pullCoordIndex_.empty(); + }); } BiasCoupledToSystem::BiasCoupledToSystem(Bias bias, const std::vector& pullCoordIndex) : @@ -506,7 +492,7 @@ void Awh::writeToEnergyFrame(int64_t step, t_enxframe* frame) const /* Get the total number of energy subblocks that AWH needs */ int numSubblocks = 0; - for (auto& biasCoupledToSystem : biasCoupledToSystem_) + for (const auto& biasCoupledToSystem : biasCoupledToSystem_) { numSubblocks += biasCoupledToSystem.bias_.numEnergySubblocksToWrite(); } @@ -524,7 +510,7 @@ void Awh::writeToEnergyFrame(int64_t step, t_enxframe* frame) const /* Transfer AWH data blocks to energy sub blocks */ int energySubblockCount = 0; - for (auto& biasCoupledToSystem : biasCoupledToSystem_) + for (const auto& biasCoupledToSystem : biasCoupledToSystem_) { energySubblockCount += biasCoupledToSystem.bias_.writeToEnergySubblocks( &(awhEnergyBlock->sub[energySubblockCount])); @@ -554,14 +540,9 @@ bool Awh::needForeignEnergyDifferences(const int64_t step) const /* Check whether the bias(es) that has/have a FEP lambda dimension should sample coordinates * this step. Since the biases may have different sampleCoordStep it is necessary to check * this combination. */ - for (const auto& biasCts : biasCoupledToSystem_) - { - if (biasCts.bias_.hasFepLambdaDimension() && biasCts.bias_.isSampleCoordStep(step)) - { - return true; - } - } - return false; + return std::any_of(biasCoupledToSystem_.begin(), biasCoupledToSystem_.end(), [step](const auto& biasCts) { + return biasCts.bias_.hasFepLambdaDimension() && biasCts.bias_.isSampleCoordStep(step); + }); } std::unique_ptr prepareAwhModule(FILE* fplog, diff --git a/src/gromacs/applied_forces/awh/awh.h b/src/gromacs/applied_forces/awh/awh.h index 7529537394..d44f295eb2 100644 --- a/src/gromacs/applied_forces/awh/awh.h +++ b/src/gromacs/applied_forces/awh/awh.h @@ -275,7 +275,6 @@ private: */ bool isOutputStep(int64_t step) const; -private: std::vector biasCoupledToSystem_; /**< AWH biases and definitions of their coupling to the system. */ const int64_t seed_; /**< Random seed for MC jumping with umbrella type bias potential. */ const int nstout_; /**< Interval in steps for writing to energy file. */ diff --git a/src/gromacs/applied_forces/awh/biasstate.cpp b/src/gromacs/applied_forces/awh/biasstate.cpp index 636f724c8c..55442b10fd 100644 --- a/src/gromacs/applied_forces/awh/biasstate.cpp +++ b/src/gromacs/applied_forces/awh/biasstate.cpp @@ -314,7 +314,7 @@ void BiasState::calcConvolvedPmf(ArrayRef dimParams, { double freeEnergyWeights = 0; const GridPoint& point = grid.point(m); - for (auto& neighbor : point.neighbor) + for (const auto& neighbor : point.neighbor) { /* Do not convolve the bias along a lambda axis - only use the pmf from the current point */ if (!pointsHaveDifferentLambda(grid, m, neighbor)) @@ -411,7 +411,7 @@ int BiasState::warnForHistogramAnomalies(const BiasGrid& grid, int biasIndex, do /* Sum up the histograms and get their normalization */ double sumVisits = 0; double sumWeights = 0; - for (auto& pointState : points_) + for (const auto& pointState : points_) { if (pointState.inTargetRegion()) { @@ -677,7 +677,7 @@ void BiasState::doSkippedUpdatesInNeighborhood(const BiasParams& params, const B /* For each neighbor point of the center point, refresh its state by adding the results of all past, skipped updates. */ const std::vector& neighbors = grid.point(coordState_.gridpointIndex()).neighbor; - for (auto& neighbor : neighbors) + for (const auto& neighbor : neighbors) { bool didUpdate = points_[neighbor].performPreviouslySkippedUpdates( params, histogramSize_.numUpdates(), weightHistScaling, logPmfsumScaling); diff --git a/src/gromacs/applied_forces/awh/biaswriter.h b/src/gromacs/applied_forces/awh/biaswriter.h index 420a26ff63..20451d9215 100644 --- a/src/gromacs/applied_forces/awh/biaswriter.h +++ b/src/gromacs/applied_forces/awh/biaswriter.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -193,7 +193,6 @@ private: */ void prepareBiasOutput(const Bias& bias); -private: std::vector block_; /**< The data blocks */ std::map outputTypeToBlock_; /**< Start block index for each variable, -1 when variable should not be written */ }; diff --git a/src/gromacs/applied_forces/awh/correlationgrid.h b/src/gromacs/applied_forces/awh/correlationgrid.h index a1c4338d03..eaaed1c22b 100644 --- a/src/gromacs/applied_forces/awh/correlationgrid.h +++ b/src/gromacs/applied_forces/awh/correlationgrid.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -150,7 +150,6 @@ public: */ int getNumBlocks() const; -public: const double dtSample; /**< Time in between samples. */ const BlockLengthMeasure blockLengthMeasure; /**< The measure for the block length. */ private: diff --git a/src/gromacs/applied_forces/awh/histogramsize.cpp b/src/gromacs/applied_forces/awh/histogramsize.cpp index 15d1ace4ba..c42e913f79 100644 --- a/src/gromacs/applied_forces/awh/histogramsize.cpp +++ b/src/gromacs/applied_forces/awh/histogramsize.cpp @@ -155,7 +155,7 @@ bool histogramIsEquilibrated(ArrayRef pointStates) /* Get the total weight of the total weight histogram; needed for normalization. */ double totalWeight = 0; int numTargetPoints = 0; - for (auto& pointState : pointStates) + for (const auto& pointState : pointStates) { if (!pointState.inTargetRegion()) { @@ -177,7 +177,7 @@ bool histogramIsEquilibrated(ArrayRef pointStates) /* Sum up weight of points that do or don't pass the check. */ double equilibratedWeight = 0; double notEquilibratedWeight = 0; - for (auto& pointState : pointStates) + for (const auto& pointState : pointStates) { double targetWeight = pointState.target(); double sampledWeight = pointState.weightSumTot() * inverseTotalWeight; diff --git a/src/gromacs/applied_forces/awh/tests/.clang-tidy b/src/gromacs/applied_forces/awh/tests/.clang-tidy new file mode 100644 index 0000000000..0adf51e3ee --- /dev/null +++ b/src/gromacs/applied_forces/awh/tests/.clang-tidy @@ -0,0 +1,91 @@ +# List of rationales for check suppressions (where known). +# This have to precede the list because inline comments are not +# supported by clang-tidy. +# +# -cppcoreguidelines-non-private-member-variables-in-classes, +# -misc-non-private-member-variables-in-classes, +# We intend a gradual transition to conform to this guideline, but it +# is not practical to implement yet. +# +# -readability-isolate-declaration, +# Declarations like "int a, b;" are readable. Some forms are not, and +# those might reasonably be suggested against during code review. +# +# -cppcoreguidelines-avoid-c-arrays, +# C arrays are still necessary in many places with legacy code +# +# -cppcoreguidelines-avoid-magic-numbers, +# -readability-magic-numbers, +# We have many legitimate use cases for magic numbers +# +# -cppcoreguidelines-macro-usage, +# We do use too many macros, and we should fix many of them, but there +# is no reasonable way to suppress the check e.g. in src/config.h and +# configuring the build is a major legitimate use of macros. +# +# -cppcoreguidelines-narrowing-conversions, +# -bugprone-narrowing-conversions +# We have many cases where int is converted to float and we don't care +# enough about such potential loss of precision to use explicit casts +# in large numbers of places. +# +# -google-readability-avoid-underscore-in-googletest-name +# We need to use underscores for readability for our legacy types +# and command-line parameter names +# +# -misc-no-recursion +# We have way too many functions and methods relying on recursion +# +# -cppcoreguidelines-avoid-non-const-global-variables +# There are quite a lot of static variables in the test code that +# can not be replaced. +# +# -modernize-avoid-bind +# Some code needs to use std::bind and can't be modernized quickly. +Checks: clang-diagnostic-*,-clang-analyzer-*,-clang-analyzer-security.insecureAPI.strcpy, + bugprone-*,misc-*,readability-*,performance-*,mpi-*, + -readability-inconsistent-declaration-parameter-name, + -readability-function-size,-readability-else-after-return, + modernize-use-nullptr,modernize-use-emplace, + modernize-make-unique,modernize-make-shared, + modernize-avoid-bind, + modernize-use-override, + modernize-redundant-void-arg,modernize-use-bool-literals, + cppcoreguidelines-*,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory, + -cppcoreguidelines-no-malloc,-cppcoreguidelines-special-member-functions, + -cppcoreguidelines-avoid-goto, + google-*,-google-build-using-namespace,-google-explicit-constructor, + -google-readability-function-size,-google-readability-todo,-google-runtime-int, + -cppcoreguidelines-non-private-member-variables-in-classes, + -misc-non-private-member-variables-in-classes, + -readability-isolate-declaration, + -cppcoreguidelines-avoid-c-arrays, + -cppcoreguidelines-avoid-magic-numbers, + -readability-magic-numbers, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-narrowing-conversions, + -bugprone-narrowing-conversions, + -google-readability-avoid-underscore-in-googletest-name, + -cppcoreguidelines-init-variables, + -misc-no-recursion, + -cppcoreguidelines-avoid-non-const-global-variables, + -modernize-avoid-bind +HeaderFilterRegex: .* +CheckOptions: + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: 1 + - key: modernize-make-unique.IncludeStyle + value: google + - key: modernize-make-shared.IncludeStyle + value: google + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 1 + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 1 + - key: bugprone-dangling-handle.HandleClasses + value: std::basic_string_view; nonstd::sv_lite::basic_string_view +# Permit passing shard pointers by value for sink parameters + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: shared_ptr + - key: performance-unnecessary-value-param.AllowedTypes + value: shared_ptr diff --git a/src/gromacs/applied_forces/awh/tests/bias.cpp b/src/gromacs/applied_forces/awh/tests/bias.cpp index e1015c5b6d..880ae18f90 100644 --- a/src/gromacs/applied_forces/awh/tests/bias.cpp +++ b/src/gromacs/applied_forces/awh/tests/bias.cpp @@ -188,7 +188,7 @@ TEST_P(BiasTest, ForcesBiasPmf) } std::vector pointBias, logPmfsum; - for (auto& point : bias.state().points()) + for (const auto& point : bias.state().points()) { pointBias.push_back(point.bias()); logPmfsum.push_back(point.logPmfSum()); diff --git a/src/gromacs/applied_forces/awh/tests/bias_fep_lambda_state.cpp b/src/gromacs/applied_forces/awh/tests/bias_fep_lambda_state.cpp index 787b88f960..5e1e016185 100644 --- a/src/gromacs/applied_forces/awh/tests/bias_fep_lambda_state.cpp +++ b/src/gromacs/applied_forces/awh/tests/bias_fep_lambda_state.cpp @@ -200,7 +200,7 @@ TEST_P(BiasFepLambdaStateTest, ForcesBiasPmf) } std::vector pointBias, logPmfsum; - for (auto& point : bias.state().points()) + for (const auto& point : bias.state().points()) { pointBias.push_back(point.bias()); logPmfsum.push_back(point.logPmfSum()); diff --git a/src/gromacs/applied_forces/awh/tests/biasgrid.cpp b/src/gromacs/applied_forces/awh/tests/biasgrid.cpp index d008eac9ec..3d4d2565bc 100644 --- a/src/gromacs/applied_forces/awh/tests/biasgrid.cpp +++ b/src/gromacs/applied_forces/awh/tests/biasgrid.cpp @@ -149,7 +149,7 @@ TEST(biasGridTest, neighborhood) haveCorrectNumNeighbors = false; } - for (auto& j : point.neighbor) + for (const auto& j : point.neighbor) { if (j >= 0 && j < numPoints) { @@ -187,7 +187,7 @@ TEST(biasGridTest, neighborhood) } /* Clear the marked points in the checking grid */ - for (auto& neighbor : point.neighbor) + for (const auto& neighbor : point.neighbor) { if (neighbor >= 0 && neighbor < numPoints) { diff --git a/src/gromacs/applied_forces/densityfitting/densityfitting.cpp b/src/gromacs/applied_forces/densityfitting/densityfitting.cpp index af6af7678a..b5d10ea80d 100644 --- a/src/gromacs/applied_forces/densityfitting/densityfitting.cpp +++ b/src/gromacs/applied_forces/densityfitting/densityfitting.cpp @@ -198,7 +198,7 @@ public: void setSimulationTimeStep(double timeStep) { simulationTimeStep_ = timeStep; } //! Return the simulation time step - double simulationTimeStep() { return simulationTimeStep_; } + double simulationTimeStep() const { return simulationTimeStep_; } private: //! The reference density to fit to diff --git a/src/gromacs/applied_forces/densityfitting/densityfittingparameters.h b/src/gromacs/applied_forces/densityfitting/densityfittingparameters.h index 0e123ef5bc..f6dc43ae95 100644 --- a/src/gromacs/applied_forces/densityfitting/densityfittingparameters.h +++ b/src/gromacs/applied_forces/densityfitting/densityfittingparameters.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -83,9 +83,9 @@ struct DensityFittingParameters //! The time constant for the adaptive force scaling in ps real adaptiveForceScalingTimeConstant_ = 4; //! Translation of the structure, so that the coordinates that are fitted are x+translation - std::string translationString_ = ""; + std::string translationString_; //! Linear transformation of the structure, so that the coordinates that are fitted are Matrix * x - std::string transformationMatrixString_ = ""; + std::string transformationMatrixString_; }; /*!\brief Check if two structs holding density fitting parameters are equal. diff --git a/src/gromacs/applied_forces/densityfitting/tests/.clang-tidy b/src/gromacs/applied_forces/densityfitting/tests/.clang-tidy new file mode 100644 index 0000000000..0adf51e3ee --- /dev/null +++ b/src/gromacs/applied_forces/densityfitting/tests/.clang-tidy @@ -0,0 +1,91 @@ +# List of rationales for check suppressions (where known). +# This have to precede the list because inline comments are not +# supported by clang-tidy. +# +# -cppcoreguidelines-non-private-member-variables-in-classes, +# -misc-non-private-member-variables-in-classes, +# We intend a gradual transition to conform to this guideline, but it +# is not practical to implement yet. +# +# -readability-isolate-declaration, +# Declarations like "int a, b;" are readable. Some forms are not, and +# those might reasonably be suggested against during code review. +# +# -cppcoreguidelines-avoid-c-arrays, +# C arrays are still necessary in many places with legacy code +# +# -cppcoreguidelines-avoid-magic-numbers, +# -readability-magic-numbers, +# We have many legitimate use cases for magic numbers +# +# -cppcoreguidelines-macro-usage, +# We do use too many macros, and we should fix many of them, but there +# is no reasonable way to suppress the check e.g. in src/config.h and +# configuring the build is a major legitimate use of macros. +# +# -cppcoreguidelines-narrowing-conversions, +# -bugprone-narrowing-conversions +# We have many cases where int is converted to float and we don't care +# enough about such potential loss of precision to use explicit casts +# in large numbers of places. +# +# -google-readability-avoid-underscore-in-googletest-name +# We need to use underscores for readability for our legacy types +# and command-line parameter names +# +# -misc-no-recursion +# We have way too many functions and methods relying on recursion +# +# -cppcoreguidelines-avoid-non-const-global-variables +# There are quite a lot of static variables in the test code that +# can not be replaced. +# +# -modernize-avoid-bind +# Some code needs to use std::bind and can't be modernized quickly. +Checks: clang-diagnostic-*,-clang-analyzer-*,-clang-analyzer-security.insecureAPI.strcpy, + bugprone-*,misc-*,readability-*,performance-*,mpi-*, + -readability-inconsistent-declaration-parameter-name, + -readability-function-size,-readability-else-after-return, + modernize-use-nullptr,modernize-use-emplace, + modernize-make-unique,modernize-make-shared, + modernize-avoid-bind, + modernize-use-override, + modernize-redundant-void-arg,modernize-use-bool-literals, + cppcoreguidelines-*,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory, + -cppcoreguidelines-no-malloc,-cppcoreguidelines-special-member-functions, + -cppcoreguidelines-avoid-goto, + google-*,-google-build-using-namespace,-google-explicit-constructor, + -google-readability-function-size,-google-readability-todo,-google-runtime-int, + -cppcoreguidelines-non-private-member-variables-in-classes, + -misc-non-private-member-variables-in-classes, + -readability-isolate-declaration, + -cppcoreguidelines-avoid-c-arrays, + -cppcoreguidelines-avoid-magic-numbers, + -readability-magic-numbers, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-narrowing-conversions, + -bugprone-narrowing-conversions, + -google-readability-avoid-underscore-in-googletest-name, + -cppcoreguidelines-init-variables, + -misc-no-recursion, + -cppcoreguidelines-avoid-non-const-global-variables, + -modernize-avoid-bind +HeaderFilterRegex: .* +CheckOptions: + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: 1 + - key: modernize-make-unique.IncludeStyle + value: google + - key: modernize-make-shared.IncludeStyle + value: google + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 1 + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 1 + - key: bugprone-dangling-handle.HandleClasses + value: std::basic_string_view; nonstd::sv_lite::basic_string_view +# Permit passing shard pointers by value for sink parameters + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: shared_ptr + - key: performance-unnecessary-value-param.AllowedTypes + value: shared_ptr diff --git a/src/gromacs/applied_forces/tests/.clang-tidy b/src/gromacs/applied_forces/tests/.clang-tidy new file mode 100644 index 0000000000..0adf51e3ee --- /dev/null +++ b/src/gromacs/applied_forces/tests/.clang-tidy @@ -0,0 +1,91 @@ +# List of rationales for check suppressions (where known). +# This have to precede the list because inline comments are not +# supported by clang-tidy. +# +# -cppcoreguidelines-non-private-member-variables-in-classes, +# -misc-non-private-member-variables-in-classes, +# We intend a gradual transition to conform to this guideline, but it +# is not practical to implement yet. +# +# -readability-isolate-declaration, +# Declarations like "int a, b;" are readable. Some forms are not, and +# those might reasonably be suggested against during code review. +# +# -cppcoreguidelines-avoid-c-arrays, +# C arrays are still necessary in many places with legacy code +# +# -cppcoreguidelines-avoid-magic-numbers, +# -readability-magic-numbers, +# We have many legitimate use cases for magic numbers +# +# -cppcoreguidelines-macro-usage, +# We do use too many macros, and we should fix many of them, but there +# is no reasonable way to suppress the check e.g. in src/config.h and +# configuring the build is a major legitimate use of macros. +# +# -cppcoreguidelines-narrowing-conversions, +# -bugprone-narrowing-conversions +# We have many cases where int is converted to float and we don't care +# enough about such potential loss of precision to use explicit casts +# in large numbers of places. +# +# -google-readability-avoid-underscore-in-googletest-name +# We need to use underscores for readability for our legacy types +# and command-line parameter names +# +# -misc-no-recursion +# We have way too many functions and methods relying on recursion +# +# -cppcoreguidelines-avoid-non-const-global-variables +# There are quite a lot of static variables in the test code that +# can not be replaced. +# +# -modernize-avoid-bind +# Some code needs to use std::bind and can't be modernized quickly. +Checks: clang-diagnostic-*,-clang-analyzer-*,-clang-analyzer-security.insecureAPI.strcpy, + bugprone-*,misc-*,readability-*,performance-*,mpi-*, + -readability-inconsistent-declaration-parameter-name, + -readability-function-size,-readability-else-after-return, + modernize-use-nullptr,modernize-use-emplace, + modernize-make-unique,modernize-make-shared, + modernize-avoid-bind, + modernize-use-override, + modernize-redundant-void-arg,modernize-use-bool-literals, + cppcoreguidelines-*,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory, + -cppcoreguidelines-no-malloc,-cppcoreguidelines-special-member-functions, + -cppcoreguidelines-avoid-goto, + google-*,-google-build-using-namespace,-google-explicit-constructor, + -google-readability-function-size,-google-readability-todo,-google-runtime-int, + -cppcoreguidelines-non-private-member-variables-in-classes, + -misc-non-private-member-variables-in-classes, + -readability-isolate-declaration, + -cppcoreguidelines-avoid-c-arrays, + -cppcoreguidelines-avoid-magic-numbers, + -readability-magic-numbers, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-narrowing-conversions, + -bugprone-narrowing-conversions, + -google-readability-avoid-underscore-in-googletest-name, + -cppcoreguidelines-init-variables, + -misc-no-recursion, + -cppcoreguidelines-avoid-non-const-global-variables, + -modernize-avoid-bind +HeaderFilterRegex: .* +CheckOptions: + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: 1 + - key: modernize-make-unique.IncludeStyle + value: google + - key: modernize-make-shared.IncludeStyle + value: google + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 1 + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 1 + - key: bugprone-dangling-handle.HandleClasses + value: std::basic_string_view; nonstd::sv_lite::basic_string_view +# Permit passing shard pointers by value for sink parameters + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: shared_ptr + - key: performance-unnecessary-value-param.AllowedTypes + value: shared_ptr