diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 151814945..445daf273 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,11 @@ ci: submodules: true repos: - repo: https://github.com/BlankSpruce/gersemi - rev: 0.19.3 + rev: 0.22.3 hooks: - id: gersemi - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.2 + rev: v0.13.3 hooks: - id: ruff args: @@ -17,12 +17,12 @@ repos: - --exit-non-zero-on-fix - id: ruff-format - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.7 + rev: v21.1.2 hooks: - id: clang-format args: - '--style={BasedOnStyle: Mozilla, SortIncludes: false}' - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace diff --git a/include/proxsuite/helpers/tl-optional.hpp b/include/proxsuite/helpers/tl-optional.hpp index 4154b00f2..65859cbb7 100644 --- a/include/proxsuite/helpers/tl-optional.hpp +++ b/include/proxsuite/helpers/tl-optional.hpp @@ -980,8 +980,7 @@ class optional #ifndef TL_OPTIONAL_NO_CONSTRR template constexpr decltype(optional_map_impl(std::declval(), - std::declval())) - map(F&& f) const&& + std::declval())) map(F&& f) const&& { return optional_map_impl(std::move(*this), std::forward(f)); } @@ -1044,8 +1043,8 @@ class optional #ifndef TL_OPTIONAL_NO_CONSTRR template constexpr decltype(optional_map_impl(std::declval(), - std::declval())) - transform(F&& f) const&& + std::declval())) transform(F&& f) + const&& { return optional_map_impl(std::move(*this), std::forward(f)); } @@ -2035,8 +2034,8 @@ class optional #ifndef TL_OPTIONAL_NO_CONSTRR template constexpr decltype(detail::optional_map_impl(std::declval(), - std::declval())) - map(F&& f) const&& + std::declval())) map(F&& f) + const&& { return detail::optional_map_impl(std::move(*this), std::forward(f)); } @@ -2101,9 +2100,9 @@ class optional #ifndef TL_OPTIONAL_NO_CONSTRR template - constexpr decltype(detail::optional_map_impl(std::declval(), - std::declval())) - transform(F&& f) const&& + constexpr decltype(detail::optional_map_impl( + std::declval(), + std::declval())) transform(F&& f) const&& { return detail::optional_map_impl(std::move(*this), std::forward(f)); } diff --git a/include/proxsuite/linalg/veg/internal/dyn_index.hpp b/include/proxsuite/linalg/veg/internal/dyn_index.hpp index 990f354d3..369e08ed9 100644 --- a/include/proxsuite/linalg/veg/internal/dyn_index.hpp +++ b/include/proxsuite/linalg/veg/internal/dyn_index.hpp @@ -94,8 +94,7 @@ struct Dyn (typename R), requires(VEG_CONCEPT(index) && VEG_CONCEPT(index::Div>)), - VEG_NODISCARD VEG_INLINE constexpr auto - operator/, + VEG_NODISCARD VEG_INLINE constexpr auto operator/, (b, R)) const VEG_NOEXCEPT->typename _detail::binary_traits::Div { diff --git a/include/proxsuite/linalg/veg/internal/fix_index.hpp b/include/proxsuite/linalg/veg/internal/fix_index.hpp index dc2e00411..9834aa884 100644 --- a/include/proxsuite/linalg/veg/internal/fix_index.hpp +++ b/include/proxsuite/linalg/veg/internal/fix_index.hpp @@ -142,8 +142,7 @@ struct Fix : _detail::idx::adl::IdxBase> (typename R), requires(VEG_CONCEPT(index) && VEG_CONCEPT(index::Div>)), - VEG_NODISCARD VEG_INLINE constexpr auto - operator/, + VEG_NODISCARD VEG_INLINE constexpr auto operator/, (b, R)) const VEG_NOEXCEPT->typename _detail::binary_traits::Div { diff --git a/include/proxsuite/linalg/veg/internal/macros.hpp b/include/proxsuite/linalg/veg/internal/macros.hpp index bb15d8ce6..d38aa906c 100644 --- a/include/proxsuite/linalg/veg/internal/macros.hpp +++ b/include/proxsuite/linalg/veg/internal/macros.hpp @@ -587,10 +587,7 @@ template \ struct Name \ { \ - void apply(Ts&&... args) \ - { \ - Fn(VEG_FWD(args)...); \ - } \ + void apply(Ts&&... args) { Fn(VEG_FWD(args)...); } \ }; \ template struct Name<__VA_ARGS__> diff --git a/include/proxsuite/linalg/veg/memory/placement.hpp b/include/proxsuite/linalg/veg/memory/placement.hpp index cb1afbc8a..fd951a712 100644 --- a/include/proxsuite/linalg/veg/memory/placement.hpp +++ b/include/proxsuite/linalg/veg/memory/placement.hpp @@ -176,8 +176,7 @@ struct bit_cast requires((VEG_CONCEPT(trivially_copyable) && // VEG_CONCEPT(trivially_copyable) && // (sizeof(From) == sizeof(To)))), - VEG_INLINE VEG_BITCAST_CONSTEXPR auto - operator(), + VEG_INLINE VEG_BITCAST_CONSTEXPR auto operator(), (from, From const&)) const VEG_NOEXCEPT->To { diff --git a/include/proxsuite/linalg/veg/type_traits/constructible.hpp b/include/proxsuite/linalg/veg/type_traits/constructible.hpp index ab5d028ba..a0ad2772f 100644 --- a/include/proxsuite/linalg/veg/type_traits/constructible.hpp +++ b/include/proxsuite/linalg/veg/type_traits/constructible.hpp @@ -48,7 +48,7 @@ VEG_DEF_CONCEPT_FROM_BUILTIN_OR_TRAIT(typename T, VEG_CONCEPT_EXPR((typename T, typename... Ts), (T, Ts...), inplace_constructible, - new(static_cast(nullptr)) T(VEG_DECLVAL(Ts&&)...), + new (static_cast(nullptr)) T(VEG_DECLVAL(Ts&&)...), true); VEG_DEF_CONCEPT_FROM_BUILTIN_OR_STD((typename T, typename... Ts), diff --git a/test/doctest/doctest.hpp b/test/doctest/doctest.hpp index 427f570d5..fd4072374 100644 --- a/test/doctest/doctest.hpp +++ b/test/doctest/doctest.hpp @@ -525,7 +525,8 @@ consume(const int*, int) noexcept #define DOCTEST_BREAK_INTO_DEBUGGER() __debugbreak() #elif defined(__MINGW32__) DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wredundant-decls") -extern "C" __declspec(dllimport) void __stdcall DebugBreak(); +extern "C" __declspec(dllimport) void __stdcall +DebugBreak(); DOCTEST_GCC_SUPPRESS_WARNING_POP #define DOCTEST_BREAK_INTO_DEBUGGER() ::DebugBreak() #else // linux @@ -1454,8 +1455,7 @@ struct DOCTEST_INTERFACE Approx #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template typename std::enable_if::value, - Approx&>::type - epsilon(const T& newEpsilon) + Approx&>::type epsilon(const T& newEpsilon) { m_epsilon = static_cast(newEpsilon); return *this; @@ -1467,8 +1467,7 @@ struct DOCTEST_INTERFACE Approx #ifdef DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS template typename std::enable_if::value, - Approx&>::type - scale(const T& newScale) + Approx&>::type scale(const T& newScale) { m_scale = static_cast(newScale); return *this; @@ -5046,7 +5045,8 @@ getContextOptions() DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4738) template -IsNaN::operator bool() const +IsNaN:: +operator bool() const { return std::isnan(value) ^ flipped; }