Skip to content

Commit 64519e9

Browse files
style: Update yscope-dev-utils to use the clang-format v21 config; Format C++ files using clang-format v21. (#215)
1 parent 017533e commit 64519e9

File tree

13 files changed

+76
-49
lines changed

13 files changed

+76
-49
lines changed

src/spider/client/task.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ struct ConcatTaskGraphType<TaskGraph<GraphReturnType, GraphParams...>, InputType
6161
template <TaskIo GraphReturnType, TaskIo... GraphParams, TaskIo ReturnType, TaskIo... TaskParams>
6262
struct ConcatTaskGraphType<
6363
TaskGraph<GraphReturnType, GraphParams...>,
64-
TaskFunction<ReturnType, TaskParams...>> {
64+
TaskFunction<ReturnType, TaskParams...>
65+
> {
6566
using Type = TaskGraph<GraphReturnType, GraphParams..., TaskParams...>;
6667
};
6768

6869
template <TaskIo GraphReturnType, TaskIo... GraphParams, TaskIo ReturnType, TaskIo... TaskParams>
6970
struct ConcatTaskGraphType<
7071
TaskGraph<GraphReturnType, GraphParams...>,
71-
TaskGraph<ReturnType, TaskParams...>> {
72+
TaskGraph<ReturnType, TaskParams...>
73+
> {
7274
using Type = TaskGraph<GraphReturnType, GraphParams..., TaskParams...>;
7375
};
7476

@@ -85,8 +87,10 @@ struct MergeTaskGraphTypes<TaskGraph<ReturnType, GraphParams...>, InputType, Inp
8587
using Type = typename MergeTaskGraphTypes<
8688
typename ConcatTaskGraphType<
8789
TaskGraph<ReturnType, GraphParams...>,
88-
std::remove_cvref_t<InputType>>::Type,
89-
Inputs...>::Type;
90+
std::remove_cvref_t<InputType>
91+
>::Type,
92+
Inputs...
93+
>::Type;
9094
};
9195

9296
template <TaskIo ReturnType, RunnableOrTaskIo... Inputs>

src/spider/core/TaskGraphImpl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class TaskGraphImpl {
147147
Task task{function_name.value()};
148148
// Add task inputs
149149
for_n<sizeof...(TaskParams)>([&](auto i) {
150-
using T = std::remove_cvref_t<
151-
std::tuple_element_t<i.cValue, std::tuple<TaskParams...>>>;
150+
using T = std::
151+
remove_cvref_t<std::tuple_element_t<i.cValue, std::tuple<TaskParams...>>>;
152152
if constexpr (cIsSpecializationV<T, spider::Data>) {
153153
task.add_input(TaskInput{typeid(spider::core::Data).name()});
154154
} else {

src/spider/io/Serializer.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,15 @@ struct msgpack::adaptor::pack<boost::uuids::uuid> {
4343

4444
template <class Buffer, class T>
4545
concept Packable = requires(Buffer buffer, T t) {
46-
{
47-
msgpack::pack(buffer, t)
48-
};
46+
{ msgpack::pack(buffer, t) };
4947
};
5048

5149
template <class T>
5250
concept SerializableImpl = Packable<msgpack::sbuffer, T>;
5351

5452
template <class T>
5553
concept DeSerializableImpl = requires(T t) {
56-
{
57-
msgpack::object{}.convert(t)
58-
};
54+
{ msgpack::object{}.convert(t) };
5955
};
6056

6157
template <class T>

src/spider/storage/mysql/MySqlStorage.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,10 @@ auto MySqlMetadataStorage::add_job(
433433
add_task(static_cast<MySqlConnection&>(conn), job_id_bytes, *task, TaskState::Ready);
434434
for (boost::uuids::uuid const id : task_graph.get_child_tasks(task_id)) {
435435
std::vector<boost::uuids::uuid> const parents = task_graph.get_parent_tasks(id);
436-
if (std::ranges::all_of(parents, [&](boost::uuids::uuid const& parent) {
437-
return heads.contains(parent);
438-
}))
436+
if (std::ranges::all_of(
437+
parents,
438+
[&](boost::uuids::uuid const& parent) { return heads.contains(parent); }
439+
))
439440
{
440441
queue.push_back(id);
441442
}
@@ -456,9 +457,12 @@ auto MySqlMetadataStorage::add_job(
456457
add_task(static_cast<MySqlConnection&>(conn), job_id_bytes, *task, std::nullopt);
457458
for (boost::uuids::uuid const id : task_graph.get_child_tasks(task_id)) {
458459
std::vector<boost::uuids::uuid> const parents = task_graph.get_parent_tasks(id);
459-
if (std::ranges::all_of(parents, [&](boost::uuids::uuid const& parent) {
460-
return heads.contains(parent);
461-
}))
460+
if (std::ranges::all_of(
461+
parents,
462+
[&](boost::uuids::uuid const& parent) {
463+
return heads.contains(parent);
464+
}
465+
))
462466
{
463467
queue.push_back(id);
464468
}
@@ -561,9 +565,10 @@ auto MySqlMetadataStorage::add_job_batch(
561565
);
562566
for (boost::uuids::uuid const id : task_graph.get_child_tasks(task_id)) {
563567
std::vector<boost::uuids::uuid> const parents = task_graph.get_parent_tasks(id);
564-
if (std::ranges::all_of(parents, [&](boost::uuids::uuid const& parent) {
565-
return heads.contains(parent);
566-
}))
568+
if (std::ranges::all_of(
569+
parents,
570+
[&](boost::uuids::uuid const& parent) { return heads.contains(parent); }
571+
))
567572
{
568573
queue.push_back(id);
569574
}
@@ -589,9 +594,12 @@ auto MySqlMetadataStorage::add_job_batch(
589594
);
590595
for (boost::uuids::uuid const id : task_graph.get_child_tasks(task_id)) {
591596
std::vector<boost::uuids::uuid> const parents = task_graph.get_parent_tasks(id);
592-
if (std::ranges::all_of(parents, [&](boost::uuids::uuid const& parent) {
593-
return heads.contains(parent);
594-
}))
597+
if (std::ranges::all_of(
598+
parents,
599+
[&](boost::uuids::uuid const& parent) {
600+
return heads.contains(parent);
601+
}
602+
))
595603
{
596604
queue.push_back(id);
597605
}

src/spider/tdl/parser/ast/node_impl/Function.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ class Function : public Node {
8686
requires(std::is_invocable_r_v<
8787
ystdlib::error_handling::Result<void>,
8888
ParamVisitor,
89-
NamedVar const&>)
89+
NamedVar const&
90+
>)
9091
[[nodiscard]] auto visit_params(ParamVisitor visitor) const
9192
-> ystdlib::error_handling::Result<void> {
9293
for (size_t child_idx{get_num_non_param_children()}; child_idx < get_num_children();

src/spider/tdl/parser/ast/node_impl/Namespace.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class Namespace : public Node {
7373
requires(std::is_invocable_r_v<
7474
ystdlib::error_handling::Result<void>,
7575
FuncVisitor,
76-
Function const&>)
76+
Function const&
77+
>)
7778
[[nodiscard]] auto visit_functions(FuncVisitor visitor) const
7879
-> ystdlib::error_handling::Result<void> {
7980
for (size_t child_idx{1}; child_idx < get_num_children(); ++child_idx) {

src/spider/tdl/parser/ast/node_impl/StructSpec.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class StructSpec : public Node {
7373
requires(std::is_invocable_r_v<
7474
ystdlib::error_handling::Result<void>,
7575
FieldVisitor,
76-
NamedVar const&>)
76+
NamedVar const&
77+
>)
7778
[[nodiscard]] auto visit_fields(FieldVisitor visitor) const
7879
-> ystdlib::error_handling::Result<void> {
7980
for (size_t child_idx{1}; child_idx < get_num_children(); ++child_idx) {

src/spider/worker/FunctionManager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ using ArgsBuffer = msgpack::sbuffer;
4444

4545
using ResultBuffer = msgpack::sbuffer;
4646

47-
using Function = std::function<
48-
ResultBuffer(TaskContext& context, boost::uuids::uuid task_id, ArgsBuffer const&)>;
47+
using Function = std::
48+
function<ResultBuffer(TaskContext& context, boost::uuids::uuid task_id, ArgsBuffer const&)>;
4949

5050
using FunctionMap = std::vector<std::pair<std::string, Function>>;
5151

src/spider/worker/TaskExecutor.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class TaskExecutor {
4646
std::vector<std::string> const& libs,
4747
absl::flat_hash_map<
4848
boost::process::v2::environment::key,
49-
boost::process::v2::environment::value> const& environment,
49+
boost::process::v2::environment::value
50+
> const& environment,
5051
Args&&... args
5152
)
5253
: m_read_pipe(context),
@@ -104,7 +105,8 @@ class TaskExecutor {
104105
std::vector<std::string> const& libs,
105106
absl::flat_hash_map<
106107
boost::process::v2::environment::key,
107-
boost::process::v2::environment::value> const& environment,
108+
boost::process::v2::environment::value
109+
> const& environment,
108110
std::vector<msgpack::sbuffer> const& args_buffers
109111
)
110112
: m_read_pipe(context),

src/spider/worker/worker.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ auto parse_args(int const argc, char** argv) -> boost::program_options::variable
104104

105105
auto get_environment_variable() -> absl::flat_hash_map<
106106
boost::process::v2::environment::key,
107-
boost::process::v2::environment::value> {
107+
boost::process::v2::environment::value
108+
> {
108109
boost::filesystem::path const executable_dir = boost::dll::program_location().parent_path();
109110

110111
// NOLINTNEXTLINE(concurrency-mt-unsafe)
@@ -115,7 +116,8 @@ auto get_environment_variable() -> absl::flat_hash_map<
115116

116117
absl::flat_hash_map<
117118
boost::process::v2::environment::key,
118-
boost::process::v2::environment::value>
119+
boost::process::v2::environment::value
120+
>
119121
environment_variables;
120122

121123
environment_variables.emplace("PATH", path_env);
@@ -350,7 +352,8 @@ auto task_loop(
350352
std::vector<std::string> const& libs,
351353
absl::flat_hash_map<
352354
boost::process::v2::environment::key,
353-
boost::process::v2::environment::value> const& environment
355+
boost::process::v2::environment::value
356+
> const& environment
354357
) -> void {
355358
std::optional<boost::uuids::uuid> fail_task_id = std::nullopt;
356359
while (!spider::core::StopFlag::is_stop_requested()) {
@@ -499,7 +502,8 @@ auto main(int argc, char** argv) -> int {
499502

500503
absl::flat_hash_map<
501504
boost::process::v2::environment::key,
502-
boost::process::v2::environment::value> const environment_variables
505+
boost::process::v2::environment::value
506+
> const environment_variables
503507
= get_environment_variable();
504508

505509
// Start a thread that periodically updates the scheduler's heartbeat

0 commit comments

Comments
 (0)