From 1f8cfe90cfe56e544b9157e5484160930eba68f4 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Tue, 30 Apr 2024 15:40:32 +0300 Subject: [PATCH] suppress false lint --- src/tml/parser.hpp | 2 ++ tests/unit/src/parser_extra_info.cpp | 1 + tests/unit/src/value_conversion.cpp | 11 ++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tml/parser.hpp b/src/tml/parser.hpp index db8d942..8cd1d32 100644 --- a/src/tml/parser.hpp +++ b/src/tml/parser.hpp @@ -138,10 +138,12 @@ class parser void process_char_in_raw_python_string(char c, tml::listener& listener); void process_char_in_raw_python_string_closing_sequence(char c, tml::listener& listener); + // NOLINTNEXTLINE(modernize-use-designated-initializers, "needs C++20, but we use C++17") location cur_loc = {1, 1}; // offset starts with 1 void next_line(); + // NOLINTNEXTLINE(modernize-use-designated-initializers, "needs C++20, but we use C++17") extra_info info = {{}, tml::flag::first_on_line}; // extra info saved for parsed string when moving to string_parsed state diff --git a/tests/unit/src/parser_extra_info.cpp b/tests/unit/src/parser_extra_info.cpp index 6f37fc5..9ccc965 100644 --- a/tests/unit/src/parser_extra_info.cpp +++ b/tests/unit/src/parser_extra_info.cpp @@ -693,6 +693,7 @@ const tst::set set2("parser_location", [](tst::suite& suite){ struct listener : public tml::listener{ bool string_parsed = false; + // NOLINTNEXTLINE(modernize-use-designated-initializers, "needs C++20, but we use C++17") tml::extra_info info = {{0, 0}}; void on_string_parsed(std::string_view str, const tml::extra_info& info)override{ if(str == "hello"){ diff --git a/tests/unit/src/value_conversion.cpp b/tests/unit/src/value_conversion.cpp index 5fa7304..0fd4adf 100644 --- a/tests/unit/src/value_conversion.cpp +++ b/tests/unit/src/value_conversion.cpp @@ -125,12 +125,13 @@ const tst::set set("value_conversion", [](tst::suite& suite){ suite.add>( "convert_to_bool", { + // NOLINTNEXTLINE(modernize-use-designated-initializers, "needs C++20, but we use C++17") {tml::leaf(true), "true", true}, - {tml::leaf(false), "false", false}, - {tml::leaf(""), "", false}, - {tml::leaf("werqwe"), "werqwe", false}, - {tml::leaf("false"s), "false", false}, - {tml::leaf("true"sv), "true", true} + {tml::leaf(false), "false", false}, // NOLINT(modernize-use-designated-initializers) + {tml::leaf(""), "", false}, // NOLINT(modernize-use-designated-initializers) + {tml::leaf("werqwe"), "werqwe", false}, // NOLINT(modernize-use-designated-initializers) + {tml::leaf("false"s), "false", false}, // NOLINT(modernize-use-designated-initializers) + {tml::leaf("true"sv), "true", true} // NOLINT(modernize-use-designated-initializers) }, [](auto& p){ auto value = p.leaf.to_bool();