Skip to content

Commit

Permalink
chore(deps): pre-commit.ci autoupdate (#1020)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/psf/black: 24.2.0 →
24.3.0](psf/black@24.2.0...24.3.0)
- [github.com/pre-commit/mirrors-clang-format: v17.0.6 →
v18.1.1](pre-commit/mirrors-clang-format@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>
  • Loading branch information
pre-commit-ci[bot] authored Mar 19, 2024
1 parent 6cd171a commit dc93d7a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.3.0
hooks:
- id: black

Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions include/CLI/TypeTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ template <typename T, typename C> class is_direct_constructible {
#pragma diag_suppress 2361
#endif
#endif
TT{std::declval<CC>()}
TT{std::declval<CC>()}
#ifdef __CUDACC__
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
#pragma nv_diag_default 2361
#else
#pragma diag_default 2361
#endif
#endif
,
std::is_move_assignable<TT>());
,
std::is_move_assignable<TT>());

template <typename TT, typename CC> static auto test(int, std::false_type) -> std::false_type;

Expand Down
4 changes: 2 additions & 2 deletions include/CLI/impl/App_inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 1 addition & 2 deletions tests/HelpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
7 changes: 2 additions & 5 deletions tests/HelpersTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,8 @@ 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"});
}(),
CLI::BadNameString);
CHECK_THROWS_AS([&]() { std::tie(shorts, longs, pname) = CLI::detail::get_names({"one", "two"}); }(),
CLI::BadNameString);
}

TEST_CASE("String: ToLower", "[helpers]") { CHECK("one and two" == CLI::detail::to_lower("one And TWO")); }
Expand Down

0 comments on commit dc93d7a

Please sign in to comment.