فهرست منبع

test: suppress non-const global variable warnings by the linter

Michele Caini 2 سال پیش
والد
کامیت
f920a84ac0

+ 0 - 1
.clang-tidy

@@ -5,7 +5,6 @@ Checks: >
     -cppcoreguidelines-avoid-c-arrays,
     -cppcoreguidelines-avoid-const-or-ref-data-members,
     -cppcoreguidelines-avoid-magic-numbers,
-    -cppcoreguidelines-avoid-non-const-global-variables,
     -cppcoreguidelines-pro-*,
     misc-*,
     -misc-no-recursion,

+ 2 - 2
test/entt/core/any.cpp

@@ -25,7 +25,7 @@ struct empty {
         ++counter;
     }
 
-    inline static int counter = 0;
+    inline static int counter = 0; // NOLINT
 };
 
 struct fat {
@@ -43,7 +43,7 @@ struct fat {
         return std::equal(std::begin(value), std::end(value), std::begin(other.value), std::end(other.value));
     }
 
-    inline static int counter{0};
+    inline static int counter{0}; // NOLINT
     double value[4];
 };
 

+ 3 - 3
test/entt/meta/meta_any.cpp

@@ -24,7 +24,7 @@ struct clazz_t {
         return value;
     }
 
-    inline static char c = 'c';
+    inline static char c = 'c'; // NOLINT
     int value{0};
 };
 
@@ -42,8 +42,8 @@ struct empty_t {
         ++destroy_counter;
     }
 
-    inline static int destroy_counter = 0;
-    inline static int destructor_counter = 0;
+    inline static int destroy_counter = 0;    // NOLINT
+    inline static int destructor_counter = 0; // NOLINT
 };
 
 struct fat_t: empty_t {

+ 2 - 2
test/entt/meta/meta_context.cpp

@@ -50,7 +50,7 @@ struct clazz: base {
     }
 
     int value{};
-    inline static int bucket{};
+    inline static int bucket{}; // NOLINT
 };
 
 struct argument {
@@ -137,7 +137,7 @@ public:
         entt::meta_reset();
     }
 
-    [[nodiscard]] const entt::meta_ctx& ctx() const noexcept {
+    [[nodiscard]] const entt::meta_ctx &ctx() const noexcept {
         return context;
     }
 

+ 4 - 4
test/entt/meta/meta_data.cpp

@@ -21,7 +21,7 @@ struct base_t {
         ++counter;
     }
 
-    inline static int counter = 0;
+    inline static int counter = 0; // NOLINT
     int value{3};
 };
 
@@ -37,8 +37,8 @@ struct clazz_t {
     int i{0};
     const int j{1};
     base_t base{};
-    inline static int h{2};
-    inline static const int k{3};
+    inline static int h{2};       // NOLINT
+    inline static const int k{3}; // NOLINT
 };
 
 struct setter_getter_t {
@@ -82,7 +82,7 @@ struct multi_setter_t {
 };
 
 struct array_t {
-    inline static int global[3];
+    inline static int global[3]; // NOLINT
     int local[5];
 };
 

+ 1 - 1
test/entt/meta/meta_dtor.cpp

@@ -21,7 +21,7 @@ struct clazz_t {
         ++counter;
     }
 
-    inline static int counter = 0;
+    inline static int counter = 0; // NOLINT
 };
 
 struct MetaDtor: ::testing::Test {

+ 2 - 2
test/entt/meta/meta_func.cpp

@@ -31,7 +31,7 @@ struct base_t {
         ref.value = v;
     }
 
-    inline static int counter = 0;
+    inline static int counter = 0; // NOLINT
     int value{3};
 };
 
@@ -86,7 +86,7 @@ struct func_t {
         return value;
     }
 
-    inline static int value = 0;
+    inline static int value = 0; // NOLINT
 };
 
 double double_member(const double &value) {

+ 3 - 3
test/entt/meta/meta_utility.cpp

@@ -41,9 +41,9 @@ struct clazz {
 
     int member{};
     const int cmember{};
-    inline static int value{};
-    inline static const int cvalue{};
-    inline static int arr[3u]{};
+    inline static int value{};        // NOLINT
+    inline static const int cvalue{}; // NOLINT
+    inline static int arr[3u]{};      // NOLINT
 };
 
 struct MetaUtility: ::testing::Test {

+ 2 - 2
test/entt/process/scheduler.cpp

@@ -27,7 +27,7 @@ struct succeeded_process: entt::process<succeeded_process, entt::scheduler::delt
         succeed();
     }
 
-    inline static unsigned int invoked;
+    inline static unsigned int invoked; // NOLINT
 };
 
 struct failed_process: entt::process<failed_process, entt::scheduler::delta_type> {
@@ -36,7 +36,7 @@ struct failed_process: entt::process<failed_process, entt::scheduler::delta_type
         fail();
     }
 
-    inline static unsigned int invoked;
+    inline static unsigned int invoked; // NOLINT
 };
 
 struct Scheduler: ::testing::Test {