Skip to content

Commit 2e43a5c

Browse files
Update pre-commit settings (#144)
1 parent a16f3b8 commit 2e43a5c

File tree

6 files changed

+38
-25
lines changed

6 files changed

+38
-25
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
# Workflow files stored in the
10+
# default location of `.github/workflows`
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"

.github/workflows/format.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ on:
1010
jobs:
1111
pre-commit:
1212
name: pre-commit
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
1616
- uses: actions/setup-python@v5
17-
- name: Install clang-format-14
18-
run: sudo apt-get install clang-format-14
17+
- name: Install clang-format
18+
run: sudo apt-get install clang-format
1919
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
# Standard hooks
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-added-large-files
77
- id: check-ast
88
- id: check-builtin-literals
9-
- id: check-byte-order-marker
9+
- id: fix-byte-order-marker
1010
- id: check-case-conflict
1111
- id: check-docstring-first
1212
- id: check-executables-have-shebangs
@@ -33,14 +33,14 @@ repos:
3333
hooks:
3434
- id: clang-format
3535
name: clang-format
36-
description: Format files with ClangFormat 14.
37-
entry: clang-format-14
36+
description: Format files with ClangFormat.
37+
entry: clang-format
3838
language: system
3939
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
4040
args: ['-fallback-style=none', '-i']
4141

4242
- repo: https://github.com/codespell-project/codespell
43-
rev: v2.3.0
43+
rev: v2.4.1
4444
hooks:
4545
- id: codespell
4646
args: ['--write-changes', '--ignore-words=.codespell_words']

include/rsl/monad.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace rsl {
2020
* @return Return type of fn
2121
*/
2222
template <typename T, typename Fn>
23-
[[nodiscard]] constexpr auto mbind(std::optional<T> const& opt, Fn fn)
24-
-> std::invoke_result_t<Fn, T> {
23+
[[nodiscard]] constexpr auto mbind(std::optional<T> const& opt,
24+
Fn fn) -> std::invoke_result_t<Fn, T> {
2525
static_assert(std::is_convertible_v<std::nullopt_t, std::invoke_result_t<Fn, T>>,
2626
"Fn must return a std::optional");
2727
if (opt) return fn(opt.value());
@@ -41,8 +41,8 @@ template <typename T, typename Fn>
4141
* @return Return type of the function
4242
*/
4343
template <typename T, typename E, typename Fn>
44-
[[nodiscard]] constexpr auto mbind(tl::expected<T, E> const& exp, Fn fn)
45-
-> std::invoke_result_t<Fn, T> {
44+
[[nodiscard]] constexpr auto mbind(tl::expected<T, E> const& exp,
45+
Fn fn) -> std::invoke_result_t<Fn, T> {
4646
if (exp) return fn(exp.value());
4747
return tl::unexpected(exp.error());
4848
}

include/rsl/parameter_validators.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ namespace rsl {
2121
namespace detail {
2222
template <typename T, typename Fn>
2323
[[nodiscard]] auto size_compare(rclcpp::Parameter const& parameter, size_t const size,
24-
std::string const& predicate_description, Fn const& predicate)
25-
-> tl::expected<void, std::string> {
24+
std::string const& predicate_description,
25+
Fn const& predicate) -> tl::expected<void, std::string> {
2626
static constexpr auto format_string = "Length of parameter '{}' is '{}' but must be {} '{}'";
2727
switch (parameter.get_type()) {
2828
case rclcpp::ParameterType::PARAMETER_STRING:
@@ -40,8 +40,8 @@ template <typename T, typename Fn>
4040

4141
template <typename T, typename Fn>
4242
[[nodiscard]] auto compare(rclcpp::Parameter const& parameter, T const& value,
43-
std::string const& predicate_description, Fn const& predicate)
44-
-> tl::expected<void, std::string> {
43+
std::string const& predicate_description,
44+
Fn const& predicate) -> tl::expected<void, std::string> {
4545
if (auto const param_value = parameter.get_value<T>(); !predicate(param_value, value))
4646
return tl::unexpected(fmt::format("Parameter '{}' with the value '{}' must be {} '{}'",
4747
parameter.get_name(), param_value, predicate_description,
@@ -166,8 +166,8 @@ template <typename T>
166166
* @return Help string if the parameter is invalid, otherwise void
167167
*/
168168
template <typename T>
169-
[[nodiscard]] auto lower_element_bounds(rclcpp::Parameter const& parameter, T const& lower)
170-
-> tl::expected<void, std::string> {
169+
[[nodiscard]] auto lower_element_bounds(rclcpp::Parameter const& parameter,
170+
T const& lower) -> tl::expected<void, std::string> {
171171
auto const& param_value = parameter.get_value<std::vector<T>>();
172172
for (auto val : param_value)
173173
if (val < lower)
@@ -184,8 +184,8 @@ template <typename T>
184184
* @return Help string if the parameter is invalid, otherwise void
185185
*/
186186
template <typename T>
187-
[[nodiscard]] auto upper_element_bounds(rclcpp::Parameter const& parameter, T const& upper)
188-
-> tl::expected<void, std::string> {
187+
[[nodiscard]] auto upper_element_bounds(rclcpp::Parameter const& parameter,
188+
T const& upper) -> tl::expected<void, std::string> {
189189
auto const& param_value = parameter.get_value<std::vector<T>>();
190190
for (auto val : param_value)
191191
if (val > upper)
@@ -202,8 +202,8 @@ template <typename T>
202202
* @return Help string if the parameter is invalid, otherwise void
203203
*/
204204
template <typename T>
205-
[[nodiscard]] auto bounds(rclcpp::Parameter const& parameter, T const& lower, T const& upper)
206-
-> tl::expected<void, std::string> {
205+
[[nodiscard]] auto bounds(rclcpp::Parameter const& parameter, T const& lower,
206+
T const& upper) -> tl::expected<void, std::string> {
207207
auto const& param_value = parameter.get_value<T>();
208208
if (param_value < lower || param_value > upper)
209209
return tl::unexpected(
@@ -287,8 +287,8 @@ template <typename T>
287287
* @return Help string if the parameter is invalid, otherwise void
288288
*/
289289
template <typename T>
290-
[[nodiscard]] auto one_of(rclcpp::Parameter const& parameter, std::vector<T> const& collection)
291-
-> tl::expected<void, std::string> {
290+
[[nodiscard]] auto one_of(rclcpp::Parameter const& parameter,
291+
std::vector<T> const& collection) -> tl::expected<void, std::string> {
292292
auto const& param_value = parameter.get_value<T>();
293293
if (contains(collection, param_value)) return {};
294294
return tl::unexpected(fmt::format(

include/rsl/strong_type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class StrongType {
3030
/**
3131
* @brief Get const reference to underlying value
3232
*/
33-
[[nodiscard]] constexpr const T& get() const { return value_; }
33+
[[nodiscard]] constexpr T const& get() const { return value_; }
3434

3535
/**
3636
* @brief Explicit conversion to underlying type

0 commit comments

Comments
 (0)