* 🚨 suppress readability-redundant-parentheses

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress google-runtime-float

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🗑️ do not use macos-13 image

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ use more Xcode versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔨 clean up

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2025-10-22 11:14:01 +02:00
committed by GitHub
parent 3ed64e502a
commit 2566828ed5
11 changed files with 54 additions and 39 deletions

View File

@@ -173,6 +173,7 @@ TEST_CASE_TEMPLATE_DEFINE("value_in_range_of trait", T, value_in_range_of_test)
}
}
// NOLINTNEXTLINE(bugprone-throwing-static-initialization)
TEST_CASE_TEMPLATE_INVOKE(value_in_range_of_test, \
trait_test_arg<std::int32_t, std::int32_t, true, true>, \
trait_test_arg<std::int32_t, std::uint32_t, true, false>, \
@@ -198,6 +199,7 @@ TEST_CASE_TEMPLATE_INVOKE(value_in_range_of_test, \
trait_test_arg<std::size_t, std::int64_t, false, false>, \
trait_test_arg<std::size_t, std::uint64_t, true, false>);
#else
// NOLINTNEXTLINE(bugprone-throwing-static-initialization)
TEST_CASE_TEMPLATE_INVOKE(value_in_range_of_test, \
trait_test_arg<std::size_t, std::int32_t, false, true>, \
trait_test_arg<std::size_t, std::uint32_t, true, true>, \

View File

@@ -1143,7 +1143,7 @@ TEST_CASE("deserialization")
#define ASCII_TYPES TYPE_LIST(char, wchar_t, char16_t, char32_t)
#endif
TEST_CASE_TEMPLATE("deserialization of different character types (ASCII)", T, ASCII_TYPES) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("deserialization of different character types (ASCII)", T, ASCII_TYPES) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
std::vector<T> const v = {'t', 'r', 'u', 'e'};
CHECK(json::parse(v) == json(true));
@@ -1155,7 +1155,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (ASCII)", T, AS
CHECK(l.events == std::vector<std::string>({"boolean(true)"}));
}
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T, char, unsigned char, std::uint8_t) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T, char, unsigned char, std::uint8_t) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
// a star emoji
std::vector<T> const v = {'"', static_cast<T>(0xe2u), static_cast<T>(0xadu), static_cast<T>(0x90u), static_cast<T>(0xefu), static_cast<T>(0xb8u), static_cast<T>(0x8fu), '"'};
@@ -1167,7 +1167,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T, ch
CHECK(l.events.size() == 1);
}
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T, char16_t) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T, char16_t) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
// a star emoji
std::vector<T> const v = {static_cast<T>('"'), static_cast<T>(0x2b50), static_cast<T>(0xfe0f), static_cast<T>('"')};
@@ -1179,7 +1179,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T, c
CHECK(l.events.size() == 1);
}
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-32)", T, char32_t) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("deserialization of different character types (UTF-32)", T, char32_t) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
// a star emoji
std::vector<T> const v = {static_cast<T>('"'), static_cast<T>(0x2b50), static_cast<T>(0xfe0f), static_cast<T>('"')};

View File

@@ -16,7 +16,7 @@
// build test with C++14
// JSON_HAS_CPP_14
TEST_CASE_TEMPLATE("element access 2", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("element access 2", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
SECTION("object")
{
@@ -1455,7 +1455,7 @@ TEST_CASE_TEMPLATE("element access 2", Json, nlohmann::json, nlohmann::ordered_j
}
#if !defined(JSON_NOEXCEPTION)
TEST_CASE_TEMPLATE("element access 2 (throwing tests)", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("element access 2 (throwing tests)", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
SECTION("object")
{
@@ -1491,7 +1491,7 @@ TEST_CASE_TEMPLATE("element access 2 (throwing tests)", Json, nlohmann::json, nl
#endif
// TODO(falbrechtskirchinger) merge with the other test case; clean up
TEST_CASE_TEMPLATE("element access 2 (additional value() tests)", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("element access 2 (additional value() tests)", Json, nlohmann::json, nlohmann::ordered_json) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
using string_t = typename Json::string_t;
using number_integer_t = typename Json::number_integer_t;

View File

@@ -20,7 +20,7 @@ using nlohmann::json;
#endif
#ifdef JSON_HAS_CPP_14
TEST_CASE_TEMPLATE("checking forward-iterators", T, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("checking forward-iterators", T, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::vector<int>, std::string, nlohmann::json)
{
auto it1 = typename T::iterator{};

View File

@@ -1121,7 +1121,7 @@ TEST_CASE("regression tests 2")
#endif
}
TEST_CASE_TEMPLATE("issue #4798 - nlohmann::json::to_msgpack() encode float NaN as double", T, double, float) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("issue #4798 - nlohmann::json::to_msgpack() encode float NaN as double", T, double, float) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
// With issue #4798, we encode NaN, infinity, and -infinity as float instead
// of double to allow for smaller encodings.

View File

@@ -165,7 +165,7 @@ TEST_CASE("serialization")
}
}
TEST_CASE_TEMPLATE("serialization for extreme integer values", T, int32_t, uint32_t, int64_t, uint64_t) // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("serialization for extreme integer values", T, int32_t, uint32_t, int64_t, uint64_t) // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
{
SECTION("minimum")
{

View File

@@ -462,7 +462,7 @@ class derived_person_only_serialize_private : person_without_default_constructor
} // namespace persons
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRUSIVE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRUSIVE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::person_with_private_data>,
std::pair<nlohmann::json, persons::person_without_private_data_1>,
std::pair<nlohmann::json, persons::person_without_private_data_2>,
@@ -497,7 +497,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRU
}
}
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::derived_person_with_private_data>,
std::pair<nlohmann::json, persons::derived_person_without_private_data_1>,
std::pair<nlohmann::json, persons::derived_person_without_private_data_2>,
@@ -532,7 +532,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TY
}
}
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::person_with_private_data_2>,
std::pair<nlohmann::json, persons::person_without_private_data_3>,
std::pair<nlohmann::ordered_json, persons::person_with_private_data_2>,
@@ -583,7 +583,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_TYPE_INTRU
}
}
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::derived_person_with_private_data_2>,
std::pair<nlohmann::json, persons::derived_person_without_private_data_3>,
std::pair<nlohmann::ordered_json, persons::derived_person_with_private_data_2>,
@@ -629,7 +629,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization via NLOHMANN_DEFINE_DERIVED_TY
}
}
TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/private member variables via NLOHMANN_DEFINE_TYPE_INTRUSIVE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/private member variables via NLOHMANN_DEFINE_TYPE_INTRUSIVE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::person_with_private_alphabet>,
std::pair<nlohmann::json, persons::person_with_public_alphabet>,
std::pair<nlohmann::ordered_json, persons::person_with_private_alphabet>,
@@ -648,7 +648,7 @@ TEST_CASE_TEMPLATE("Serialization/deserialization of classes with 26 public/priv
}
}
TEST_CASE_TEMPLATE("Serialization of non-default-constructible classes via NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization of non-default-constructible classes via NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::person_without_default_constructor_1>,
std::pair<nlohmann::json, persons::person_without_default_constructor_2>,
std::pair<nlohmann::ordered_json, persons::person_without_default_constructor_1>,
@@ -678,7 +678,7 @@ TEST_CASE_TEMPLATE("Serialization of non-default-constructible classes via NLOHM
}
}
TEST_CASE_TEMPLATE("Serialization of non-default-constructible classes via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE", Pair, // NOLINT(readability-math-missing-parentheses)
TEST_CASE_TEMPLATE("Serialization of non-default-constructible classes via NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE and NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE", Pair, // NOLINT(readability-math-missing-parentheses, bugprone-throwing-static-initialization)
std::pair<nlohmann::json, persons::derived_person_only_serialize_public>,
std::pair<nlohmann::json, persons::derived_person_only_serialize_private>,
std::pair<nlohmann::ordered_json, persons::derived_person_only_serialize_public>,