From 853213f077df1b30396f958dd4ae4478c14682c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20W=C3=B6lzer?= <martin@libclapp.org> Date: Tue, 17 Sep 2024 06:46:16 +0200 Subject: [PATCH] .gitlab-ci/format.yml: updated clang-format from 11 to 18 --- .gitlab-ci/format.yml | 4 ++-- examples/large_example.cpp | 15 +++++---------- examples/short_example.cpp | 9 +++------ examples/sub_parser_example.cpp | 15 +++++---------- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/.gitlab-ci/format.yml b/.gitlab-ci/format.yml index 11f818a6..0b7de6f7 100644 --- a/.gitlab-ci/format.yml +++ b/.gitlab-ci/format.yml @@ -14,9 +14,9 @@ clang-format: script: - .ci/format/apply_clang_format.sh --output-patch-file "${FORMAT_PATCH_FILE}" variables: - CLANG_COMPILER_VERSION: "11" + CLANG_COMPILER_VERSION: "18" tags: - - ubuntu-22.04-amd64 + - ubuntu-24.04-amd64 shfmt: extends: diff --git a/examples/large_example.cpp b/examples/large_example.cpp index c769776a..2e321a5d 100644 --- a/examples/large_example.cpp +++ b/examples/large_example.cpp @@ -446,8 +446,7 @@ int main(int argc, char *argv[]) { } if (!*parser) { - std::cout << "Parsing failed!" - << "\n"; + std::cout << "Parsing failed!" << "\n"; return EXIT_FAILURE; } @@ -465,21 +464,17 @@ int main(int argc, char *argv[]) { process_time_container(parser->time); if (parser->cmd1) { - std::cout << "cmd1 given" - << "\n"; + std::cout << "cmd1 given" << "\n"; process_cmd1(parser->cmd1); } else { - std::cout << "cmd1 not given" - << "\n"; + std::cout << "cmd1 not given" << "\n"; } if (parser->cmd2) { - std::cout << "cmd2 given" - << "\n"; + std::cout << "cmd2 given" << "\n"; process_cmd2(parser->cmd2); } else { - std::cout << "cmd2 not given" - << "\n"; + std::cout << "cmd2 not given" << "\n"; } } catch (clapp::clapp_exception_t &e) { std::cout << "Caught ClaPP-Exception: " << e.what() << "\n"; diff --git a/examples/short_example.cpp b/examples/short_example.cpp index 4fa07c0c..96109430 100644 --- a/examples/short_example.cpp +++ b/examples/short_example.cpp @@ -119,16 +119,14 @@ int main(int argc, char *argv[]) { } std::cout << "\n"; } else { - std::cout << "variadic-string-arg: not given" - << "\n"; + std::cout << "variadic-string-arg: not given" << "\n"; } CLAPP_CONTRACT_EXPECTS( parser->options.string_param); // The parser ensures that // mandatory options are given std::cout << "string_param: '" << parser->options.string_param.value() - << "'" - << "\n"; + << "'" << "\n"; if (parser->options .string_vector_param) { // if string_vector_param is given @@ -141,8 +139,7 @@ int main(int argc, char *argv[]) { } std::cout << "\n"; } else { - std::cout << "string_vector_param: not given" - << "\n"; + std::cout << "string_vector_param: not given" << "\n"; } } catch (clapp::clapp_exception_t &e) { std::cout << "Caught ClaPP-Exception: " << e.what() << "\n"; diff --git a/examples/sub_parser_example.cpp b/examples/sub_parser_example.cpp index b8c7d727..f5ea8c26 100644 --- a/examples/sub_parser_example.cpp +++ b/examples/sub_parser_example.cpp @@ -139,8 +139,7 @@ clapp::value::found_func_t::ret_t print_version_and_exit( clapp::value::found_func_t::ret_t print_not_implemented_and_exit( const std::string &option) { std::cout << "Option '" << option - << "' currently not implemented: don't use it!" - << "\n"; + << "' currently not implemented: don't use it!" << "\n"; return clapp::value::exit_t::exit(EXIT_FAILURE); } @@ -218,21 +217,17 @@ int main(int argc, char *argv[]) { } if (parser->first) { // if the first sub-parser is selected - std::cout << "first parser active" - << "\n"; + std::cout << "first parser active" << "\n"; process_first(parser->first); } else { - std::cout << "first parser not active" - << "\n"; + std::cout << "first parser not active" << "\n"; } if (parser->second) { // if the first sub-parser is selected - std::cout << "second parser active" - << "\n"; + std::cout << "second parser active" << "\n"; process_second(parser->second); } else { - std::cout << "second parser not active" - << "\n"; + std::cout << "second parser not active" << "\n"; } } catch (clapp::clapp_exception_t &e) { std::cout << "Caught ClaPP-Exception: " << e.what() << "\n"; -- GitLab