From a814267e2055ab5e9d52fc99e3d972f2ead66218 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:33:00 +0000 Subject: [PATCH] style: pre-commit.ci fixes --- examples/CMakeLists.txt | 4 ++-- tests/FormatterTest.cpp | 2 -- tests/HelpTest.cpp | 15 +++++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bc635ccfb..24a5be64a 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -75,8 +75,8 @@ set_property( "Working on count: 2, direct count: 2, opt count: 2" "Some value: 1.2") # test shows that the help prints out for unnamed subcommands add_test(NAME subcom_partitioned_help COMMAND subcom_partitioned --help) -set_property(TEST subcom_partitioned_help PROPERTY PASS_REGULAR_EXPRESSION - "-f,[ \\t]*--file TEXT REQUIRED" "-d,--double FLOAT") +set_property(TEST subcom_partitioned_help + PROPERTY PASS_REGULAR_EXPRESSION "-f,[ \\t]*--file TEXT REQUIRED" "-d,--double FLOAT") #################################################### add_cli_exe(config_app config_app.cpp) diff --git a/tests/FormatterTest.cpp b/tests/FormatterTest.cpp index 3840ec5ad..1df1bc7cb 100644 --- a/tests/FormatterTest.cpp +++ b/tests/FormatterTest.cpp @@ -60,7 +60,6 @@ TEST_CASE("Formatter: OptCustomize", "[formatter]") { CHECK_THAT(help, Contains("Something")); CHECK_THAT(help, Contains("--opt INT")); CHECK_THAT(help, Contains("-h, --help Print")); - } TEST_CASE("Formatter: OptCustomizeSimple", "[formatter]") { @@ -145,7 +144,6 @@ TEST_CASE("Formatter: AppCustomizeSimple", "[formatter]") { CHECK_THAT(help, Contains("\nSUBCOMMANDS:\n")); CHECK_THAT(help, Contains(" subcom2 This\n")); CHECK_THAT(help, Contains(" subcom2 This\n")); - } TEST_CASE("Formatter: AllSub", "[formatter]") { diff --git a/tests/HelpTest.cpp b/tests/HelpTest.cpp index c6827be51..a04807f7a 100644 --- a/tests/HelpTest.cpp +++ b/tests/HelpTest.cpp @@ -741,13 +741,13 @@ TEST_CASE("THelp: NextLineShouldBeAlignmentInMultilineDescription", "[help]") { const std::string help = app.help(); const auto width = app.get_formatter()->get_column_width(); - auto first_loc=help.find("first"); - auto first_new_line=help.find_last_of('\n',first_loc); - auto second_loc=help.find("second"); - auto second_new_line=help.find_last_of('\n',second_loc); - CHECK(first_loc-first_new_line-1==width); - CHECK(second_loc-second_new_line-1==width); - CHECK(second_new_line>first_loc); + auto first_loc = help.find("first"); + auto first_new_line = help.find_last_of('\n', first_loc); + auto second_loc = help.find("second"); + auto second_new_line = help.find_last_of('\n', second_loc); + CHECK(first_loc - first_new_line - 1 == width); + CHECK(second_loc - second_new_line - 1 == width); + CHECK(second_new_line > first_loc); } TEST_CASE("THelp: NiceName", "[help]") { @@ -858,7 +858,6 @@ TEST_CASE_METHOD(CapturedHelp, "CallForAllHelpOutput", "[help]") { CHECK_THAT(out.str(), Contains("SUBCOMMANDS:")); CHECK_THAT(out.str(), Contains("--help-all")); CHECK_THAT(out.str(), Contains("My Test Program")); - } TEST_CASE_METHOD(CapturedHelp, "NewFormattedHelp", "[help]") { app.formatter_fn([](const CLI::App *, std::string, CLI::AppFormatMode) { return "New Help"; });