Skip to content

Commit

Permalink
suppress false lint
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Apr 30, 2024
1 parent 72b34fe commit 1f8cfe9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/tml/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/unit/src/parser_extra_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"){
Expand Down
11 changes: 6 additions & 5 deletions tests/unit/src/value_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ const tst::set set("value_conversion", [](tst::suite& suite){
suite.add<sample_template<bool>>(
"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();
Expand Down

0 comments on commit 1f8cfe9

Please sign in to comment.