Skip to content

Commit 105505d

Browse files
kenji-miyakepre-commit-ci[bot]
authored andcommitted
ci(pre-commit): clear the exclude option (tier4#426)
* ci(pre-commit): remove unnecessary excludes Signed-off-by: Kenji Miyake <[email protected]> * ci(pre-commit): autofix * ci(pre-commit): autofix * address pre-commit for Markdown files Signed-off-by: Kenji Miyake <[email protected]> * fix Python imports Signed-off-by: Kenji Miyake <[email protected]> * address cpplint errors Signed-off-by: Kenji Miyake <[email protected]> * fix broken package.xml Signed-off-by: Kenji Miyake <[email protected]> * rename ROS parameter files Signed-off-by: Kenji Miyake <[email protected]> * fix build Signed-off-by: Kenji Miyake <[email protected]> * use autoware_lint_common Signed-off-by: Kenji Miyake <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 668e194 commit 105505d

File tree

232 files changed

+6042
-4355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+6042
-4355
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ repos:
9494
args: [--quiet]
9595
exclude: .cu
9696

97-
exclude: .svg|control/trajectory_follower|control/trajectory_follower_nodes|common/autoware_auto_cmake|common/autoware_auto_common|common/autoware_auto_geometry|common/autoware_auto_tf2|common/autoware_testing|common/fake_test_node|common/had_map_utils|common/motion_common|common/motion_testing|common/time_utils|common/vehicle_constants_manager|common/autoware_auto_perception_rviz_plugin|common/osqp_interface|simulator/simple_planning_simulator|planning/freespace_planner|planning/astar_search|planning/costmap_generator
97+
exclude: .svg
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
autoware_auto_cmake {#autoware-auto-cmake-design}
2-
===========
1+
# autoware_auto_cmake {#autoware-auto-cmake-design}
32

43
This is the design document for the `autoware_auto_cmake` package.
54

6-
7-
# Purpose
5+
## Purpose
86

97
Provide common CMake variables and functions to Autoware packages.
108

@@ -13,17 +11,17 @@ Those include:
1311
- Setting the language standard
1412
- Getting user-provided variables
1513
- Providing functions to:
16-
+ set compiler flags
17-
+ turn off optimizations
14+
- set compiler flags
15+
- turn off optimizations
1816

19-
# Design
17+
## Design
2018

21-
## Usage
19+
### Usage
2220

2321
Add `autoware_auto_cmake` as a "build_depend" in the dependent packages.
2422

25-
### CMake variables {#cmake-config-variables}
23+
#### CMake variables {#cmake-config-variables}
2624

27-
|Name|Type|Descritpion|Default|
28-
|----|----|-----------|-------|
29-
|`DOWNLOAD_ARTIFACTS`|*BOOL*|Allow downloading artifacts at build time.|`OFF`|
25+
| Name | Type | Descritpion | Default |
26+
| -------------------- | ------ | ------------------------------------------ | ------- |
27+
| `DOWNLOAD_ARTIFACTS` | _BOOL_ | Allow downloading artifacts at build time. | `OFF` |

common/autoware_auto_cmake/package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
<build_depend>ros_environment</build_depend>
1414

15-
<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
16-
<buildtool_export_depend>ament_cmake_lint_cmake</buildtool_export_depend>
1715
<buildtool_export_depend>ament_cmake_copyright</buildtool_export_depend>
16+
<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
1817
<buildtool_export_depend>ament_cmake_cppcheck</buildtool_export_depend>
1918
<buildtool_export_depend>ament_cmake_cpplint</buildtool_export_depend>
19+
<buildtool_export_depend>ament_cmake_lint_cmake</buildtool_export_depend>
2020
<buildtool_export_depend>ament_cmake_uncrustify</buildtool_export_depend>
2121

2222
<test_depend>ament_cmake_lint_cmake</test_depend>

common/autoware_auto_common/CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ if(BUILD_TESTING)
3232
# Temporarily disable cpplint and uncrustify
3333
list(APPEND AMENT_LINT_AUTO_EXCLUDE
3434
ament_cmake_cpplint
35-
ament_cmake_uncrustify
3635
)
3736

3837
ament_lint_auto_find_test_dependencies()
@@ -46,10 +45,6 @@ if(BUILD_TESTING)
4645
find_package(ament_cmake_cpplint)
4746
ament_cpplint(${FILES_MINUS_SOME})
4847

49-
# Re-enable uncrustify
50-
find_package(ament_cmake_uncrustify)
51-
ament_uncrustify(${FILES_MINUS_SOME})
52-
5348
# Unit tests
5449
set(TEST_COMMON test_common_gtest)
5550
ament_add_gtest(${TEST_COMMON}

common/autoware_auto_common/design/comparisons.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Comparisons {#helper-comparisons}
2-
===========
1+
# Comparisons {#helper-comparisons}
32

43
The `float_comparisons.hpp` library is a simple set of functions for performing approximate numerical comparisons.
54
There are separate functions for performing comparisons using absolute bounds and relative bounds. Absolute comparison checks are prefixed with `abs_` and relative checks are prefixed with `rel_`.
@@ -8,19 +7,19 @@ The `bool_comparisons.hpp` library additionally contains an XOR operator.
87

98
The intent of the library is to improve readability of code and reduce likelihood of typographical errors when using numerical and boolean comparisons.
109

11-
# Target use cases
10+
## Target use cases
1211

1312
The approximate comparisons are intended to be used to check whether two numbers lie within some absolute or relative interval.
1413
The `exclusive_or` function will test whether two values cast to different boolean values.
1514

16-
# Assumptions
15+
## Assumptions
1716

18-
* The approximate comparisons all take an `epsilon` parameter.
19-
The value of this parameter must be >= 0.
20-
* The library is only intended to be used with floating point types.
21-
A static assertion will be thrown if the library is used with a non-floating point type.
17+
- The approximate comparisons all take an `epsilon` parameter.
18+
The value of this parameter must be >= 0.
19+
- The library is only intended to be used with floating point types.
20+
A static assertion will be thrown if the library is used with a non-floating point type.
2221

23-
# Example Usage
22+
## Example Usage
2423

2524
```c++
2625
#include "common/bool_comparisons.hpp"

common/autoware_auto_common/include/common/type_traits.hpp

+57-41
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,32 @@ namespace type_traits
4141
///
4242
/// @return A boolean that should be false for any type passed into this function.
4343
///
44-
template<typename T>
44+
template <typename T>
4545
constexpr inline autoware::common::types::bool8_t COMMON_PUBLIC impossible_branch() noexcept
4646
{
4747
return sizeof(T) == 0;
4848
}
4949

5050
/// Find an index of a type in a tuple
51-
template<class QueryT, class TupleT>
51+
template <class QueryT, class TupleT>
5252
struct COMMON_PUBLIC index
5353
{
5454
static_assert(!std::is_same<TupleT, std::tuple<>>::value, "Could not find QueryT in given tuple");
5555
};
5656

5757
/// Specialization for a tuple that starts with the HeadT type. End of recursion.
58-
template<class HeadT, class ... Tail>
58+
template <class HeadT, class... Tail>
5959
struct COMMON_PUBLIC index<HeadT, std::tuple<HeadT, Tail...>>
60-
: std::integral_constant<std::int32_t, 0> {};
60+
: std::integral_constant<std::int32_t, 0>
61+
{
62+
};
6163

6264
/// Specialization for a tuple with a type different to QueryT that calls the recursive step.
63-
template<class QueryT, class HeadT, class ... Tail>
65+
template <class QueryT, class HeadT, class... Tail>
6466
struct COMMON_PUBLIC index<QueryT, std::tuple<HeadT, Tail...>>
65-
: std::integral_constant<std::int32_t, 1 + index<QueryT, std::tuple<Tail...>>::value> {};
67+
: std::integral_constant<std::int32_t, 1 + index<QueryT, std::tuple<Tail...>>::value>
68+
{
69+
};
6670

6771
///
6872
/// @brief Visit every element in a tuple.
@@ -75,13 +79,17 @@ struct COMMON_PUBLIC index<QueryT, std::tuple<HeadT, Tail...>>
7579
///
7680
/// @return Does not return anything. Capture variables in a lambda to return any values.
7781
///
78-
template<std::size_t I = 0UL, typename Callable, typename ... TypesT>
79-
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I == sizeof...(TypesT)>
80-
visit(std::tuple<TypesT...> &, Callable) noexcept {}
82+
template <std::size_t I = 0UL, typename Callable, typename... TypesT>
83+
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I == sizeof...(TypesT)> visit(
84+
std::tuple<TypesT...> &, Callable) noexcept
85+
{
86+
}
8187
/// @brief Same as the previous specialization but for const tuple.
82-
template<std::size_t I = 0UL, typename Callable, typename ... TypesT>
83-
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I == sizeof...(TypesT)>
84-
visit(const std::tuple<TypesT...> &, Callable) noexcept {}
88+
template <std::size_t I = 0UL, typename Callable, typename... TypesT>
89+
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I == sizeof...(TypesT)> visit(
90+
const std::tuple<TypesT...> &, Callable) noexcept
91+
{
92+
}
8593

8694
///
8795
/// @brief Visit every element in a tuple.
@@ -98,32 +106,37 @@ visit(const std::tuple<TypesT...> &, Callable) noexcept {}
98106
///
99107
/// @return Does not return anything. Capture variables in a lambda to return any values.
100108
///
101-
template<std::size_t I = 0UL, typename Callable, typename ... TypesT>
102-
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I != sizeof...(TypesT)>
103-
visit(std::tuple<TypesT...> & tuple, Callable callable) noexcept
109+
template <std::size_t I = 0UL, typename Callable, typename... TypesT>
110+
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I != sizeof...(TypesT)> visit(
111+
std::tuple<TypesT...> & tuple, Callable callable) noexcept
104112
{
105113
callable(std::get<I>(tuple));
106114
visit<I + 1UL, Callable, TypesT...>(tuple, callable);
107115
}
108116
/// @brief Same as the previous specialization but for const tuple.
109-
template<std::size_t I = 0UL, typename Callable, typename ... TypesT>
110-
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I != sizeof...(TypesT)>
111-
visit(const std::tuple<TypesT...> & tuple, Callable callable) noexcept
117+
template <std::size_t I = 0UL, typename Callable, typename... TypesT>
118+
COMMON_PUBLIC inline constexpr typename std::enable_if_t<I != sizeof...(TypesT)> visit(
119+
const std::tuple<TypesT...> & tuple, Callable callable) noexcept
112120
{
113121
callable(std::get<I>(tuple));
114122
visit<I + 1UL, Callable, TypesT...>(tuple, callable);
115123
}
116124

117125
/// @brief A class to compute a conjunction over given traits.
118-
template<class ...>
119-
struct COMMON_PUBLIC conjunction : std::true_type {};
126+
template <class...>
127+
struct COMMON_PUBLIC conjunction : std::true_type
128+
{
129+
};
120130
/// @brief A conjunction of another type shall derive from that type.
121-
template<class TraitT>
122-
struct COMMON_PUBLIC conjunction<TraitT>: TraitT {};
123-
template<class TraitT, class ... TraitsTs>
131+
template <class TraitT>
132+
struct COMMON_PUBLIC conjunction<TraitT> : TraitT
133+
{
134+
};
135+
template <class TraitT, class... TraitsTs>
124136
struct COMMON_PUBLIC conjunction<TraitT, TraitsTs...>
125-
: std::conditional_t<static_cast<bool>(TraitT::value), conjunction<TraitsTs...>, TraitT> {};
126-
137+
: std::conditional_t<static_cast<bool>(TraitT::value), conjunction<TraitsTs...>, TraitT>
138+
{
139+
};
127140

128141
///
129142
/// @brief A trait to check if a tuple has a type.
@@ -133,7 +146,7 @@ struct COMMON_PUBLIC conjunction<TraitT, TraitsTs...>
133146
/// @tparam QueryT A query type.
134147
/// @tparam TupleT A tuple to search the type in.
135148
///
136-
template<typename QueryT, typename TupleT>
149+
template <typename QueryT, typename TupleT>
137150
struct has_type;
138151

139152
///
@@ -142,8 +155,10 @@ struct has_type;
142155
///
143156
/// @tparam QueryT Any type.
144157
///
145-
template<typename QueryT>
146-
struct has_type<QueryT, std::tuple<>>: std::false_type {};
158+
template <typename QueryT>
159+
struct has_type<QueryT, std::tuple<>> : std::false_type
160+
{
161+
};
147162

148163
///
149164
/// @brief Recursive override of the main trait.
@@ -152,8 +167,10 @@ struct has_type<QueryT, std::tuple<>>: std::false_type {};
152167
/// @tparam HeadT Head type in the tuple.
153168
/// @tparam TailTs Rest of the tuple types.
154169
///
155-
template<typename QueryT, typename HeadT, typename ... TailTs>
156-
struct has_type<QueryT, std::tuple<HeadT, TailTs...>>: has_type<QueryT, std::tuple<TailTs...>> {};
170+
template <typename QueryT, typename HeadT, typename... TailTs>
171+
struct has_type<QueryT, std::tuple<HeadT, TailTs...>> : has_type<QueryT, std::tuple<TailTs...>>
172+
{
173+
};
157174

158175
///
159176
/// @brief End of recursion for the main `has_type` trait. Becomes a `true_type` when the first
@@ -162,9 +179,10 @@ struct has_type<QueryT, std::tuple<HeadT, TailTs...>>: has_type<QueryT, std::tup
162179
/// @tparam QueryT Query type.
163180
/// @tparam TailTs Other types in the tuple.
164181
///
165-
template<typename QueryT, typename ... TailTs>
166-
struct has_type<QueryT, std::tuple<QueryT, TailTs...>>: std::true_type {};
167-
182+
template <typename QueryT, typename... TailTs>
183+
struct has_type<QueryT, std::tuple<QueryT, TailTs...>> : std::true_type
184+
{
185+
};
168186

169187
///
170188
/// @brief A trait used to intersect types stored in tuples at compile time. The resulting
@@ -176,7 +194,7 @@ struct has_type<QueryT, std::tuple<QueryT, TailTs...>>: std::true_type {};
176194
/// @tparam TupleT1 Tuple 1
177195
/// @tparam TupleT2 Tuple 2
178196
///
179-
template<typename TupleT1, typename TupleT2>
197+
template <typename TupleT1, typename TupleT2>
180198
struct intersect
181199
{
182200
///
@@ -185,18 +203,16 @@ struct intersect
185203
/// @details This function "iterates" over the types in TupleT1 and checks if those are in
186204
/// TupleT2. If this is true, these types are concatenated into a new tuple.
187205
///
188-
template<std::size_t... Indices>
206+
template <std::size_t... Indices>
189207
static constexpr auto make_intersection(std::index_sequence<Indices...>)
190208
{
191-
return std::tuple_cat(
192-
std::conditional_t<
193-
has_type<std::tuple_element_t<Indices, TupleT1>, TupleT2>::value,
194-
std::tuple<std::tuple_element_t<Indices, TupleT1>>,
195-
std::tuple<>>{} ...);
209+
return std::tuple_cat(std::conditional_t<
210+
has_type<std::tuple_element_t<Indices, TupleT1>, TupleT2>::value,
211+
std::tuple<std::tuple_element_t<Indices, TupleT1>>, std::tuple<>>{}...);
196212
}
197213
/// The resulting tuple type.
198214
using type =
199-
decltype(make_intersection(std::make_index_sequence<std::tuple_size<TupleT1>::value> {}));
215+
decltype(make_intersection(std::make_index_sequence<std::tuple_size<TupleT1>::value>{}));
200216
};
201217

202218
} // namespace type_traits

0 commit comments

Comments
 (0)