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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a890db6..ed60d2cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,19 @@ 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 - # 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: @@ -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 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(); }