Skip to content

Commit a2eb315

Browse files
[cicd] upgrade format tool for support (#319)
1 parent 117c37c commit a2eb315

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

.github/workflows/format.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
- name: "Install"
1616
run: |
1717
pip install cmakelang
18+
wget https://apt.llvm.org/llvm.sh
19+
chmod +x llvm.sh
20+
sudo ./llvm.sh 16 all
1821
- name: "Test"
1922
run: |
2023
find . -iname "*.hpp" -o -iname "*.tpp" -o -iname "*.cpp" -o -iwholename "./support/format" | xargs \
21-
clang-format-14 --Werror --dry-run --verbose -style=file
24+
clang-format-16 --Werror --dry-run --verbose -style=file
2225
cmake-format --check CMakeLists.txt

include/fcarouge/internal/kalman.tpp

+18-15
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,16 @@ template <typename State, typename Output, typename Input, typename UpdateTypes,
8181
"discarded.")]] inline constexpr auto
8282
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::u() const
8383
-> const input &requires(not std::is_same_v<Input, void>) {
84-
return filter.u;
85-
}
84+
return filter.u;
85+
}
8686

8787
template <typename State, typename Output, typename Input, typename UpdateTypes,
8888
typename PredictionTypes>
8989
[[nodiscard("The returned estimated covariance matrix P is unexpectedly "
90-
"discarded.")]] inline constexpr auto
91-
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::p() const
92-
-> const estimate_uncertainty & {
90+
"discarded.")]] inline constexpr auto kalman<State, Output, Input,
91+
UpdateTypes,
92+
PredictionTypes>::p()
93+
const -> const estimate_uncertainty & {
9394
return filter.p;
9495
}
9596

@@ -244,24 +245,26 @@ template <typename State, typename Output, typename Input, typename UpdateTypes,
244245
"discarded.")]] inline constexpr auto
245246
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g() const
246247
-> const input_control &requires(not std::is_same_v<Input, void>) {
247-
return filter.g;
248-
}
248+
return filter.g;
249+
}
249250

250251
template <typename State, typename Output, typename Input, typename UpdateTypes,
251252
typename PredictionTypes>
252253
[[nodiscard("The returned control transition matrix G is unexpectedly "
253-
"discarded.")]] inline constexpr auto
254-
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g()
254+
"discarded.")]] inline constexpr auto kalman<State, Output, Input,
255+
UpdateTypes,
256+
PredictionTypes>::g()
255257
-> input_control &requires(not std::is_same_v<Input, void>) {
256-
return filter.g;
257-
}
258+
return filter.g;
259+
}
258260

259261
template <typename State, typename Output, typename Input, typename UpdateTypes,
260262
typename PredictionTypes>
261-
inline constexpr void
262-
kalman<State, Output, Input, UpdateTypes, PredictionTypes>::g(
263-
const auto &value,
264-
const auto &...values) requires(not std::is_same_v<Input, void>) {
263+
inline constexpr void kalman<State, Output, Input, UpdateTypes,
264+
PredictionTypes>::g(const auto &value,
265+
const auto &...values)
266+
requires(not std::is_same_v<Input, void>)
267+
{
265268
if constexpr (std::is_convertible_v<decltype(value), input_control>) {
266269
filter.g = std::move(input_control{value, values...});
267270
} else {

include/fcarouge/internal/utility.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ template <typename Type>
5151
concept algebraic = not arithmetic<Type>;
5252

5353
template <typename Type>
54-
concept eigen = requires {
55-
typename Type::PlainMatrix;
56-
};
54+
concept eigen = requires { typename Type::PlainMatrix; };
5755

5856
struct empty {
5957
inline constexpr explicit empty([[maybe_unused]] auto &&...any) noexcept {
@@ -65,7 +63,9 @@ template <typename...> struct pack {};
6563

6664
using empty_pack = pack<>;
6765

68-
template <typename Type> struct repack { using type = Type; };
66+
template <typename Type> struct repack {
67+
using type = Type;
68+
};
6969

7070
template <template <typename...> typename From, typename... Types>
7171
struct repack<From<Types...>> {
@@ -94,7 +94,7 @@ template <arithmetic Arithmetic>
9494
inline constexpr Arithmetic identity_v<Arithmetic>{1};
9595

9696
template <typename Matrix>
97-
requires requires(Matrix value) { value.Identity(); }
97+
requires requires(Matrix value) { value.Identity(); }
9898
inline const auto identity_v<Matrix>{Matrix::Identity()};
9999

100100
template <typename Type>
@@ -106,7 +106,7 @@ template <arithmetic Arithmetic>
106106
inline constexpr Arithmetic zero_v<Arithmetic>{0};
107107

108108
template <typename Matrix>
109-
requires requires(Matrix value) { value.Zero(); }
109+
requires requires(Matrix value) { value.Zero(); }
110110
inline const auto zero_v<Matrix>{Matrix::Zero()};
111111

112112
struct transpose final {
@@ -117,7 +117,7 @@ struct transpose final {
117117
}
118118

119119
template <typename Matrix>
120-
requires requires(Matrix value) { value.transpose(); }
120+
requires requires(Matrix value) { value.transpose(); }
121121
[[nodiscard]] inline constexpr auto operator()(const Matrix &value) const {
122122
return value.transpose();
123123
}

include/fcarouge/kalman.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,8 @@ class kalman final {
518518
//! control transition matrix G.
519519
//!
520520
//! @complexity Constant.
521-
inline constexpr void
522-
g(const auto &value,
523-
const auto &...values) requires(not std::is_same_v<Input, void>);
521+
inline constexpr void g(const auto &value, const auto &...values)
522+
requires(not std::is_same_v<Input, void>);
524523

525524
//! @brief Returns the gain matrix K.
526525
//!

0 commit comments

Comments
 (0)