From 69b8bd05e56f176e27e5d95565559dde1c32e37e Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Mon, 21 Oct 2024 21:44:10 -0600 Subject: [PATCH 1/2] :rotating_light: Fix clang-tidy issues --- include/cib/detail/config_item.hpp | 4 ++-- include/flow/graph_builder.hpp | 3 ++- include/flow/graphviz_builder.hpp | 5 ++++- include/interrupt/dynamic_controller.hpp | 3 ++- include/log/catalog/mipi_encoder.hpp | 12 +++++------- include/log/log.hpp | 4 ++++ include/match/predicate.hpp | 9 ++++----- include/msg/message.hpp | 5 ++++- include/seq/impl.hpp | 3 ++- include/seq/step.hpp | 4 +++- 10 files changed, 32 insertions(+), 20 deletions(-) diff --git a/include/cib/detail/config_item.hpp b/include/cib/detail/config_item.hpp index a31b130f..65bfdc74 100644 --- a/include/cib/detail/config_item.hpp +++ b/include/cib/detail/config_item.hpp @@ -4,11 +4,11 @@ namespace cib::detail { struct config_item { - [[nodiscard]] constexpr auto extends_tuple() const -> stdx::tuple<> { + [[nodiscard]] constexpr static auto extends_tuple() -> stdx::tuple<> { return {}; } - [[nodiscard]] constexpr auto exports_tuple() const -> stdx::tuple<> { + [[nodiscard]] constexpr static auto exports_tuple() -> stdx::tuple<> { return {}; } }; diff --git a/include/flow/graph_builder.hpp b/include/flow/graph_builder.hpp index 472099aa..dd470d68 100644 --- a/include/flow/graph_builder.hpp +++ b/include/flow/graph_builder.hpp @@ -297,7 +297,8 @@ struct graph_builder { constexpr static auto run() { built()(); } public: - constexpr operator FunctionPtr() const { return run; } + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr explicit(false) operator FunctionPtr() const { return run; } constexpr auto operator()() const -> void { run(); } constexpr static bool active = decltype(built())::active; }; diff --git a/include/flow/graphviz_builder.hpp b/include/flow/graphviz_builder.hpp index 48b040ec..38099276 100644 --- a/include/flow/graphviz_builder.hpp +++ b/include/flow/graphviz_builder.hpp @@ -61,7 +61,10 @@ struct graphviz_builder { static auto run() -> std::string { return built(); } public: - constexpr operator VizFunctionPtr() const { return run; } + // NOLINTNEXTLINE(google-explicit-constructor) + constexpr explicit(false) operator VizFunctionPtr() const { + return run; + } auto operator()() const -> std::string { return run(); } constexpr static bool active = true; }; diff --git a/include/interrupt/dynamic_controller.hpp b/include/interrupt/dynamic_controller.hpp index 11c8abbb..0b006aba 100644 --- a/include/interrupt/dynamic_controller.hpp +++ b/include/interrupt/dynamic_controller.hpp @@ -10,11 +10,12 @@ #include #include +#include #include #include namespace interrupt { -enum class resource_status { OFF = 0, ON = 1 }; +enum class resource_status : std::uint8_t { OFF, ON }; template concept has_enable_field = requires { Irq::enable_field; }; diff --git a/include/log/catalog/mipi_encoder.hpp b/include/log/catalog/mipi_encoder.hpp index 4e2a37e5..4190c592 100644 --- a/include/log/catalog/mipi_encoder.hpp +++ b/include/log/catalog/mipi_encoder.hpp @@ -16,9 +16,8 @@ #include #include -template struct undef; - -namespace { +namespace logging::mipi { +namespace detail { template constexpr auto to_message() { constexpr auto s = S::value; @@ -46,9 +45,8 @@ template constexpr auto to_module() { return sc::module_string>{}; }(std::make_integer_sequence{}); } -} // namespace +} // namespace detail -namespace logging::mipi { namespace defn { using msg::at; using msg::dword_index_t; @@ -125,8 +123,8 @@ template struct log_handler { template ALWAYS_INLINE auto log_msg(Msg msg) -> void { msg.apply([&](StringType, auto... args) { - using Message = decltype(to_message(msg)); - using Module = decltype(to_module()); + using Message = decltype(detail::to_message(msg)); + using Module = decltype(detail::to_module()); dispatch_message(catalog(), module(), static_cast(args)...); }); diff --git a/include/log/log.hpp b/include/log/log.hpp index 3ba9846c..35a0eb9f 100644 --- a/include/log/log.hpp +++ b/include/log/log.hpp @@ -62,6 +62,8 @@ template struct module_id_t { using cib_log_module_id_t = typename logging::module_id_t<"default">::type; +// NOLINTBEGIN(cppcoreguidelines-macro-usage) + #define CIB_DO_PRAGMA(X) _Pragma(#X) #ifdef __clang__ #define CIB_PRAGMA(X) CIB_DO_PRAGMA(clang X) @@ -118,3 +120,5 @@ template static auto log_version() -> void { #define CIB_LOG_V(FLAVOR) logging::log_version() #define CIB_LOG_VERSION() CIB_LOG_V(logging::default_flavor_t) + +// NOLINTEND(cppcoreguidelines-macro-usage) diff --git a/include/match/predicate.hpp b/include/match/predicate.hpp index 7b02264a..178b0f7d 100644 --- a/include/match/predicate.hpp +++ b/include/match/predicate.hpp @@ -15,9 +15,8 @@ template struct predicate_t { constexpr static P pred{}; - constexpr predicate_t(P) {} - - constexpr predicate_t() {} + constexpr predicate_t() = default; + constexpr explicit(true) predicate_t(P) {} [[nodiscard]] constexpr auto operator()(auto const &event) const -> decltype(pred(event)) { @@ -34,7 +33,7 @@ template struct predicate_t { }; template -constexpr auto predicate(P &&p) -> predicate_t> { - return {std::forward

(p)}; +constexpr auto predicate(P &&p) { + return predicate_t>{std::forward

(p)}; } } // namespace match diff --git a/include/msg/message.hpp b/include/msg/message.hpp index 9cf02d61..3b27afc1 100644 --- a/include/msg/message.hpp +++ b/include/msg/message.hpp @@ -127,7 +127,7 @@ template struct field_value { template struct field_name { using name_t = Name; - // NOLINTNEXTLINE(cppcoreguidelines-c-copy-assignment-signature) + // NOLINTNEXTLINE(misc-unconventional-assign-operator) template constexpr auto operator=(T value) { return field_value{value}; } @@ -369,6 +369,7 @@ template struct message { using span_t = Span; template + // NOLINTNEXTLINE(google-explicit-constructor) explicit(false) view_t(S const &s) : storage{s} {} template @@ -377,6 +378,7 @@ template struct message { } template + // NOLINTNEXTLINE(google-explicit-constructor) constexpr explicit(false) view_t(owner_t const &s LIFETIMEBOUND) : storage{s.data()} {} @@ -391,6 +393,7 @@ template struct message { std::same_as, typename span_t::element_type> and span_t::extent <= S::extent) + // NOLINTNEXTLINE(google-explicit-constructor) constexpr explicit(false) view_t(view_t const &s) : storage{s.data()} {} diff --git a/include/seq/impl.hpp b/include/seq/impl.hpp index c4c4407f..86cd7b1a 100644 --- a/include/seq/impl.hpp +++ b/include/seq/impl.hpp @@ -8,10 +8,11 @@ #include #include +#include #include namespace seq { -enum struct direction { FORWARD = 0, BACKWARD = 1 }; +enum struct direction : std::uint8_t { FORWARD, BACKWARD }; template struct impl { stdx::cx_vector _forward_steps{}; diff --git a/include/seq/step.hpp b/include/seq/step.hpp index 478d4712..2cfe6a6b 100644 --- a/include/seq/step.hpp +++ b/include/seq/step.hpp @@ -7,8 +7,10 @@ #include +#include + namespace seq { -enum struct status { NOT_DONE = 0, DONE = 1 }; +enum struct status : std::uint8_t { NOT_DONE, DONE }; using func_ptr = auto (*)() -> status; using log_func_ptr = auto (*)() -> void; From 81ce72b6319f0e7015194012f97d7bfde48d945f Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Wed, 23 Oct 2024 15:28:35 -0600 Subject: [PATCH 2/2] :arrow_up: Bump actions/checkout from 4.2.1 to 4.2.2 --- .github/workflows/asciidoctor-ghpages.yml | 2 +- .github/workflows/performance_test.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/single_header.yml | 2 +- .github/workflows/unit_tests.yml | 12 ++++++------ .github/workflows/usage_test.yml | 2 +- .gitignore | 1 + CMakeLists.txt | 6 +++--- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/asciidoctor-ghpages.yml b/.github/workflows/asciidoctor-ghpages.yml index 2657d76b..04252b76 100644 --- a/.github/workflows/asciidoctor-ghpages.yml +++ b/.github/workflows/asciidoctor-ghpages.yml @@ -33,7 +33,7 @@ jobs: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - name: Checkout source - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Node.js uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: diff --git a/.github/workflows/performance_test.yml b/.github/workflows/performance_test.yml index 6cb1fb70..082879e4 100644 --- a/.github/workflows/performance_test.yml +++ b/.github/workflows/performance_test.yml @@ -17,7 +17,7 @@ jobs: performance_test: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install compiler run: sudo apt update && sudo apt install -y clang-${{env.LLVM_VERSION}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e3fa0c8..a4bf3411 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: release: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: recursive diff --git a/.github/workflows/single_header.yml b/.github/workflows/single_header.yml index 94be7127..f2c61485 100644 --- a/.github/workflows/single_header.yml +++ b/.github/workflows/single_header.yml @@ -19,7 +19,7 @@ jobs: build_single_header: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c0edcdf4..247afa34 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -92,7 +92,7 @@ jobs: stdlib: libc++ steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | @@ -171,7 +171,7 @@ jobs: stdlib: libstdc++ steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | @@ -215,7 +215,7 @@ jobs: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - name: Checkout target branch - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{github.base_ref}} @@ -224,7 +224,7 @@ jobs: id: target_branch - name: Checkout PR branch - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | @@ -291,7 +291,7 @@ jobs: toolchain_root: "/usr" steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | @@ -338,7 +338,7 @@ jobs: valgrind: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install build tools run: | diff --git a/.github/workflows/usage_test.yml b/.github/workflows/usage_test.yml index c5f09e4b..cb5adda2 100644 --- a/.github/workflows/usage_test.yml +++ b/.github/workflows/usage_test.yml @@ -18,7 +18,7 @@ jobs: usage_test: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install compiler run: sudo apt update && sudo apt-get install -y clang-${{env.USER_LLVM_VERSION}} diff --git a/.gitignore b/.gitignore index 3d1008fa..46e6f7c5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ CMakePresets.json /toolchains mull.yml +requirements.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ffef79f..bc19f678 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,9 @@ include(cmake/string_catalog.cmake) add_versioned_package("gh:boostorg/mp11#boost-1.83.0") fmt_recipe(10.2.1) -add_versioned_package("gh:intel/cpp-std-extensions#67120f7") -add_versioned_package("gh:intel/cpp-baremetal-concurrency#630d8bc") -add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#9ea96f9") +add_versioned_package("gh:intel/cpp-baremetal-concurrency#7c5b26c") +add_versioned_package("gh:intel/cpp-std-extensions#5530b5d") +add_versioned_package("gh:intel/cpp-baremetal-senders-and-receivers#73d95bc") add_library(cib INTERFACE) target_compile_features(cib INTERFACE cxx_std_20)