Skip to content

Commit 05f1d77

Browse files
committed
Check and format json and c++ files
1 parent 713bfd4 commit 05f1d77

36 files changed

+89
-99
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
3-
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
4-
5-
{
6-
"name": "Beman Project Generic Devcontainer",
7-
"build": {
8-
"dockerfile": "Dockerfile"
9-
},
10-
"postCreateCommand": "bash .devcontainer/postcreate.sh",
11-
"customizations": {
12-
"vscode": {
13-
"extensions": [
14-
"ms-vscode.cpptools",
15-
"ms-vscode.cmake-tools"
16-
]
17-
}
18-
}
1+
{
2+
"name": "Beman Project Generic Devcontainer",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"postCreateCommand": "bash .devcontainer/postcreate.sh",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-vscode.cpptools",
11+
"ms-vscode.cmake-tools"
12+
]
1913
}
14+
}
15+
}

.pre-commit-config.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ repos:
66
hooks:
77
# TODO: - id: trailing-whitespace
88
# TODO: - id: end-of-file-fixer
9-
# FIXME: - id: check-yaml
9+
- id: check-json
10+
- id: check-yaml
11+
exclude: ^\.clang-(format|tidy)$
1012
- id: check-added-large-files
1113

12-
# TODO: Clang-format for C++
1314
# This brings in a portable version of clang-format.
1415
# See also: https://github.com/ssciwr/clang-format-wheel
15-
# - repo: https://github.com/pre-commit/mirrors-clang-format
16-
# rev: v19.1.4
17-
# hooks:
18-
# - id: clang-format
19-
# types_or: [c++, c, json]
16+
- repo: https://github.com/pre-commit/mirrors-clang-format
17+
rev: v19.1.4
18+
hooks:
19+
- id: clang-format
20+
types_or: [c++, c, json]
21+
exclude: docs/TODO.json
2022

2123
# TODO: CMake linting and formatting
2224
# - repo: https://github.com/BlankSpruce/gersemi

examples/playground.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ namespace ex = ::beman::execution26;
1010

1111
// ----------------------------------------------------------------------------
1212

13-
int main()
14-
{
13+
int main() {
1514
auto [result] = ex::sync_wait(ex::when_all(ex::just(std::string("hello, ")), ex::just(std::string("world"))) |
1615
ex::then([](const auto& s1, const auto& s2) { return s1 + s2; }))
1716
.value_or(std::tuple(std::string("oops")));

examples/stop_token.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ namespace exec = beman::execution26;
4646
// - std::print isn't available everywhere, yet. Let's try a simple
4747
// placeholder.
4848
namespace {
49-
::std::mutex io_lock;
50-
void print(std::string_view text, auto&&...) {
49+
::std::mutex io_lock;
50+
void print(std::string_view text, auto&&...) {
5151
const std::lock_guard guard(io_lock);
5252
::std::cout << text;
5353
}
@@ -71,7 +71,7 @@ struct stop_callback_for_t {
7171
#ifdef __cpp_lib_latch
7272
template <typename Token>
7373
auto inactive(const Token& token) -> void {
74-
::std::latch latch(1);
74+
::std::latch latch(1);
7575
const stop_callback_for_t cb(token, [&latch] { latch.count_down(); });
7676

7777
latch.wait();

include/beman/execution26/detail/atomic_intrusive_stack.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class atomic_intrusive_stack;
3131
//!
3232
//! @tparam Item The type of the item in the stack.
3333
//! @tparam Next The pointer to the next item in the stack.
34-
template <class Item, Item* Item::*Next>
34+
template <class Item, Item* Item::* Next>
3535
class atomic_intrusive_stack<Next> {
3636
public:
3737
atomic_intrusive_stack() = default;

include/beman/execution26/detail/completion_signatures_of_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ template <typename Sender, typename Env = ::beman::execution26::empty_env>
2020
requires ::beman::execution26::sender_in<Sender, Env>
2121
using completion_signatures_of_t =
2222
::beman::execution26::detail::call_result_t< ::beman::execution26::get_completion_signatures_t, Sender, Env>;
23-
}
23+
} // namespace beman::execution26
2424

2525
// ----------------------------------------------------------------------------
2626

include/beman/execution26/detail/completion_tag.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ template <typename Tag>
2121
concept completion_tag =
2222
::std::same_as<Tag, ::beman::execution26::set_error_t> ||
2323
::std::same_as<Tag, ::beman::execution26::set_stopped_t> || ::std::same_as<Tag, ::beman::execution26::set_value_t>;
24-
}
24+
} // namespace beman::execution26::detail
2525

2626
// ----------------------------------------------------------------------------
2727

include/beman/execution26/detail/connect_all_result.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using connect_all_result =
2323
::beman::execution26::detail::basic_state<Sender, Receiver>*,
2424
Sender,
2525
::beman::execution26::detail::indices_for<Sender> >;
26-
}
26+
} // namespace beman::execution26::detail
2727

2828
// ----------------------------------------------------------------------------
2929

include/beman/execution26/detail/decayed_tuple.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace beman::execution26::detail {
1717
*/
1818
template <typename... T>
1919
using decayed_tuple = ::std::tuple<::std::decay_t<T>...>;
20-
}
20+
} // namespace beman::execution26::detail
2121

2222
// ----------------------------------------------------------------------------
2323

include/beman/execution26/detail/decayed_typeof.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace beman::execution26::detail {
1616
*/
1717
template <auto&& Tag>
1818
using decayed_typeof = ::std::decay_t<decltype(Tag)>;
19-
}
19+
} // namespace beman::execution26::detail
2020

2121
// ----------------------------------------------------------------------------
2222

0 commit comments

Comments
 (0)