From c4ef94ae46b676a0439e779d17153aaccc605fa7 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 6 Feb 2022 22:12:51 +0000 Subject: [PATCH] Add cppcoreguidelines-non-private-member-variables-in-classes clang-tidy lint Fix the warnings it emits. --- CMakeLists.txt | 3 ++- src/api/metadata_list.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ec8388d..8ad43c2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -503,7 +503,8 @@ if(RUN_CLANG_TIDY) set(CLANG_TIDY_LIB_CHECKS ${CLANG_TIDY_COMMON_CHECKS} - "cppcoreguidelines-avoid-goto") + "cppcoreguidelines-avoid-goto" + "cppcoreguidelines-non-private-member-variables-in-classes") # Skip some checks for tests because they're not worth the noise (e.g. GTest # happens to use goto). diff --git a/src/api/metadata_list.h b/src/api/metadata_list.h index ae5798bd..494301f2 100644 --- a/src/api/metadata_list.h +++ b/src/api/metadata_list.h @@ -81,7 +81,7 @@ public: // Eval plugin conditions. void EvalAllConditions(ConditionEvaluator& conditionEvaluator); -protected: +private: std::vector groups_; std::vector bashTags_; std::unordered_map plugins_;