1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-03 22:13:51 +00:00

chore(deps): pre-commit.ci autoupdate (#1020)

<!--pre-commit.ci start-->
updates:
- [github.com/psf/black: 24.2.0 →
24.3.0](https://github.com/psf/black/compare/24.2.0...24.3.0)
- [github.com/pre-commit/mirrors-clang-format: v17.0.6 →
v18.1.1](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.6...v18.1.1)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot] 2024-03-19 05:30:33 -07:00 committed by GitHub
parent 6cd171ad3f
commit dc93d7a50c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 14 deletions

View File

@ -5,7 +5,7 @@ ci:
repos:
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.3.0
hooks:
- id: black
@ -26,7 +26,7 @@ repos:
- id: debug-statements
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.1
hooks:
- id: clang-format
types_or: [c++, c, cuda]

View File

@ -279,8 +279,8 @@ App::set_version_flag(std::string flag_name, std::function<std::string()> vfunc,
// Empty name will simply remove the version flag
if(!flag_name.empty()) {
version_ptr_ = add_flag_callback(
flag_name, [vfunc]() { throw(CLI::CallForVersion(vfunc(), 0)); }, version_help);
version_ptr_ =
add_flag_callback(flag_name, [vfunc]() { throw(CLI::CallForVersion(vfunc(), 0)); }, version_help);
version_ptr_->configurable(false);
}

View File

@ -1308,8 +1308,7 @@ TEST_CASE("TVersion: help", "[help]") {
auto hvers = app.help();
CHECK_THAT(hvers, Contains("help_for_version"));
app.set_version_flag(
"-v", []() { return std::string("VERSION2 " CLI11_VERSION); }, "help_for_version2");
app.set_version_flag("-v", []() { return std::string("VERSION2 " CLI11_VERSION); }, "help_for_version2");
hvers = app.help();
CHECK_THAT(hvers, Contains("help_for_version2"));
}

View File

@ -1058,10 +1058,7 @@ TEST_CASE("RegEx: SplittingNew", "[helpers]") {
CHECK_THROWS_AS([&]() { std::tie(shorts, longs, pname) = CLI::detail::get_names({"-hi"}); }(), CLI::BadNameString);
CHECK_THROWS_AS([&]() { std::tie(shorts, longs, pname) = CLI::detail::get_names({"---hi"}); }(),
CLI::BadNameString);
CHECK_THROWS_AS(
[&]() {
std::tie(shorts, longs, pname) = CLI::detail::get_names({"one", "two"});
}(),
CHECK_THROWS_AS([&]() { std::tie(shorts, longs, pname) = CLI::detail::get_names({"one", "two"}); }(),
CLI::BadNameString);
}