From 7b78ffb6868c38dacf66a4b02e2ce2e8ad159668 Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Thu, 17 Nov 2022 15:55:21 +0100 Subject: [PATCH 1/3] pre-commit autoupdate --- .pre-commit-config.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a890db6..8dcc6cbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,17 @@ default_stages: [commit] repos: + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - # - repo: https://github.com/pocc/pre-commit-hooks - # rev: v1.3.5 + # - repo: https://github.com/pre-commit/mirrors-clang-format + # rev: v15.0.4 # hooks: # - id: clang-format - repo: https://github.com/cheshirekow/cmake-format-precommit @@ -19,7 +23,7 @@ repos: # additional_dependencies: ["cmakelang"] # exclude: "cmake/.*" - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.10.0 hooks: - id: black language_version: python3 @@ -29,6 +33,6 @@ repos: - id: isort args: [--profile, black, --multi-line, "3"] - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 5.0.4 hooks: - id: flake8 From 2f98f19c6900fd5527df5f2d64a71c16c7c0205f Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Thu, 17 Nov 2022 16:25:50 +0100 Subject: [PATCH 2/3] enable clang format in pre-commit --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8dcc6cbf..ed60d2cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,10 +10,10 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer - # - repo: https://github.com/pre-commit/mirrors-clang-format - # rev: v15.0.4 - # hooks: - # - id: clang-format + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v15.0.4 + hooks: + - id: clang-format - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: From ca9c880c5097b8c82bc2995367e4574462668029 Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Thu, 17 Nov 2022 16:25:58 +0100 Subject: [PATCH 3/3] apply clang format --- .github/workflows/ci-check.yml | 4 ++-- example/include/validated_type.h | 4 ++-- src/core/include/units/bits/quantity_of.h | 4 ++-- src/core/include/units/quantity_point.h | 2 +- test/unit_test/static/custom_rep_test_min_expl.cpp | 2 +- test/unit_test/static/fps_test.cpp | 3 +-- test/unit_test/static/test_tools.h | 8 ++++++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index 97df38b9..dab79c62 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -28,9 +28,9 @@ jobs: check: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 - name: Install dependencies diff --git a/example/include/validated_type.h b/example/include/validated_type.h index bf44bbbc..52b7e2d8 100644 --- a/example/include/validated_type.h +++ b/example/include/validated_type.h @@ -39,7 +39,7 @@ public: constexpr explicit validated_type(const T& value) noexcept(std::is_nothrow_copy_constructible_v) requires std::copyable - : value_(value) + : value_(value) { gsl_Expects(validate(value_)); } @@ -52,7 +52,7 @@ public: constexpr validated_type(const T& value, validated_tag) noexcept(std::is_nothrow_copy_constructible_v) requires std::copyable - : value_(value) + : value_(value) { } diff --git a/src/core/include/units/bits/quantity_of.h b/src/core/include/units/bits/quantity_of.h index 1e53d22b..c8e68fb3 100644 --- a/src/core/include/units/bits/quantity_of.h +++ b/src/core/include/units/bits/quantity_of.h @@ -39,8 +39,8 @@ template typename DimTemplate> inline constexpr bool same_exponents_of, DimTemplate> = requires { typename DimTemplate, unknown_coherent_unit, typename Es::dimension...>; - }&& std::same_as, typename DimTemplate, unknown_coherent_unit, - typename Es::dimension...>::recipe>; + } && std::same_as, typename DimTemplate, unknown_coherent_unit, + typename Es::dimension...>::recipe>; } // namespace detail diff --git a/src/core/include/units/quantity_point.h b/src/core/include/units/quantity_point.h index bd3fa2fc..ecb63752 100644 --- a/src/core/include/units/quantity_point.h +++ b/src/core/include/units/quantity_point.h @@ -90,7 +90,7 @@ public: constexpr explicit quantity_point(const QP& qp) requires std::is_constructible_v::relative(qp))> && equivalent::origin> - : q_(quantity_point_like_traits::relative(qp)) + : q_(quantity_point_like_traits::relative(qp)) { } diff --git a/test/unit_test/static/custom_rep_test_min_expl.cpp b/test/unit_test/static/custom_rep_test_min_expl.cpp index 37a511f2..b1f367c1 100644 --- a/test/unit_test/static/custom_rep_test_min_expl.cpp +++ b/test/unit_test/static/custom_rep_test_min_expl.cpp @@ -51,7 +51,7 @@ public: // construction from std::int64_t constexpr explicit min_expl(std::intmax_t v) noexcept requires(Mode != 2) - : value_(v) + : value_(v) { } diff --git a/test/unit_test/static/fps_test.cpp b/test/unit_test/static/fps_test.cpp index 774971e7..b0ca5d71 100644 --- a/test/unit_test/static/fps_test.cpp +++ b/test/unit_test/static/fps_test.cpp @@ -100,7 +100,6 @@ static_assert(1_q_ft_pdl_per_s * 10_q_s == 10_q_ft_pdl); static_assert(10_q_ft_pdl / 1_q_ft_pdl_per_s == 10_q_s); static_assert(detail::unit_text() == basic_symbol_text("ft⋅pdl/s", "ft pdl/s")); -static_assert(detail::unit_text() == - basic_symbol_text("ft⋅lbf/s", "ft lbf/s")); +static_assert(detail::unit_text() == basic_symbol_text("ft⋅lbf/s", "ft lbf/s")); } // namespace diff --git a/test/unit_test/static/test_tools.h b/test/unit_test/static/test_tools.h index 4116ed7c..5781626a 100644 --- a/test/unit_test/static/test_tools.h +++ b/test/unit_test/static/test_tools.h @@ -124,8 +124,12 @@ constexpr bool ctad_constructible_from(Vs...) } constexpr auto same = [](T l, T r) { return l == r; }; -constexpr auto comp = // TODO: Fix #205 to use `std::equality_comparable_with U`. - [](T l, U r) requires compare { return l == r; }; +constexpr auto comp = // TODO: Fix #205 to use `std::equality_comparable_with U`. + [](T l, U r) + requires compare +{ + return l == r; +}; template requires requires { F(); }