From eed6527946dfc8ac5826edc366cd51cf9b1f64af Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 1 Oct 2026 13:35:37 +0000 Subject: [PATCH] style: Update pre-commit hooks (#8456) --- .pre-commit-config.yaml | 14 +++++++------- .../container/detail/aged_ordered_container.h | 4 ++-- .../container/detail/aged_unordered_container.h | 4 ++-- include/xrpl/protocol/Serializer.h | 8 ++++---- src/libxrpl/protocol/SField.cpp | 12 ++---------- src/libxrpl/protocol/XChainAttestations.cpp | 2 +- src/libxrpl/tx/transactors/lending/LoanSet.cpp | 2 +- src/test/app/ValidatorList_test.cpp | 4 ++-- src/test/app/lending/LoanBroker_test.cpp | 2 +- 9 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7212214f01..f3b566d638 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: types_or: [c++, c] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: f4d7745e17a28aad7eed2f4874ca8d1568c11c4c # frozen: v22.1.8 + rev: e2b496dc2bd8340c2524cb9a2d2a943cde1bb6df # frozen: v23.1.1 hooks: - id: clang-format args: [--style=file] @@ -82,12 +82,12 @@ repos: files: ^crates/.*\.rs$ - repo: https://github.com/BlankSpruce/gersemi-pre-commit - rev: e98930bdc210d3387007f9252d8c1694ea7e410f # frozen: 0.27.7 + rev: f1c4833f8cf23c6d952673abc73525411a5719e8 # frozen: 0.29.1 hooks: - id: gersemi - repo: https://github.com/rbubley/mirrors-prettier - rev: 9337a74165b178ae2c766f60bee7252a0f06f3e8 # frozen: v3.9.5 + rev: ef4a397f916211b4a39ccf9d3d9cbb6562157251 # frozen: v3.9.9 hooks: - id: prettier args: [--end-of-line=auto] @@ -95,7 +95,7 @@ repos: # Scoped to package/: the rest of the repo's Python has pre-existing findings, # so widening these is its own change. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 7c55798a78262d14b2074abf623d8a992ebb70d4 # frozen: v0.16.2 + rev: a56c0b927e6465d37cae3e97d35d4d18ab2b96cd # frozen: v0.16.9 hooks: - id: ruff-check args: [--fix] @@ -107,14 +107,14 @@ repos: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: 41e691678310dfd3833f7ab4e180ddb014310356 # frozen: v2.3.0 + rev: 7ff8d35ae36a7d2b968f2f90b4c723e292e594ee # frozen: v2.3.1 hooks: - id: mypy args: [--strict] files: ^package/.*\.py$ - repo: https://github.com/scop/pre-commit-shfmt - rev: 05c1426671b9237fb5e1444dd63aa5731bec0dfb # frozen: v3.13.1-1 + rev: 479be5958357ba5ab65ce47172117348516860e9 # frozen: v3.14.1-1 hooks: - id: shfmt args: [--write, --indent=4, --case-indent=true] @@ -133,7 +133,7 @@ repos: files: \.md$ - repo: https://github.com/streetsidesoftware/cspell-cli - rev: ea11f9efc0bec520073405bc30552da887ba71bc # frozen: v10.0.1 + rev: f5c5d72342f35643988a9ffa0705c05bd3ff8383 # frozen: v10.3.0 hooks: - id: cspell name: check changed files spelling diff --git a/include/xrpl/beast/container/detail/aged_ordered_container.h b/include/xrpl/beast/container/detail/aged_ordered_container.h index ec1370f3dc..04c2251222 100644 --- a/include/xrpl/beast/container/detail/aged_ordered_container.h +++ b/include/xrpl/beast/container/detail/aged_ordered_container.h @@ -820,7 +820,7 @@ public: template std::conditional_t> insert(P&& value) - requires(MaybeMap && std::is_constructible_v) + requires(MaybeMap && std::is_constructible_v) { return emplace(std::forward

(value)); } @@ -829,7 +829,7 @@ public: template std::conditional_t> insert(const_iterator hint, P&& value) - requires(MaybeMap && std::is_constructible_v) + requires(MaybeMap && std::is_constructible_v) { return emplaceHint(hint, std::forward

(value)); } diff --git a/include/xrpl/beast/container/detail/aged_unordered_container.h b/include/xrpl/beast/container/detail/aged_unordered_container.h index 8cf06cdb00..9f9d0bacf6 100644 --- a/include/xrpl/beast/container/detail/aged_unordered_container.h +++ b/include/xrpl/beast/container/detail/aged_unordered_container.h @@ -1028,7 +1028,7 @@ public: template std::conditional_t> insert(P&& value) - requires(MaybeMap && std::is_constructible_v) + requires(MaybeMap && std::is_constructible_v) { return emplace(std::forward

(value)); } @@ -1037,7 +1037,7 @@ public: template std::conditional_t> insert(const_iterator hint, P&& value) - requires(MaybeMap && std::is_constructible_v) + requires(MaybeMap && std::is_constructible_v) { return emplaceHint(hint, std::forward

(value)); } diff --git a/include/xrpl/protocol/Serializer.h b/include/xrpl/protocol/Serializer.h index b208c1e324..abce10dc0b 100644 --- a/include/xrpl/protocol/Serializer.h +++ b/include/xrpl/protocol/Serializer.h @@ -319,22 +319,22 @@ public: chop(int num); // vector-like functions - Blob ::iterator + Blob::iterator begin() { return data_.begin(); } - Blob ::iterator + Blob::iterator end() { return data_.end(); } - [[nodiscard]] Blob ::const_iterator + [[nodiscard]] Blob::const_iterator begin() const { return data_.begin(); } - [[nodiscard]] Blob ::const_iterator + [[nodiscard]] Blob::const_iterator end() const { return data_.end(); diff --git a/src/libxrpl/protocol/SField.cpp b/src/libxrpl/protocol/SField.cpp index a2d4903c6a..701be006ee 100644 --- a/src/libxrpl/protocol/SField.cpp +++ b/src/libxrpl/protocol/SField.cpp @@ -39,18 +39,10 @@ TypedField::TypedField(PrivateAccessTagT pat, Args&&... args) #define UNTYPED_SFIELD(sfName, stiSuffix, fieldValue, ...) \ SField const sfName( \ - access, \ - STI_##stiSuffix, \ - fieldValue, \ - std::string_view(#sfName).substr(2).data(), \ - ##__VA_ARGS__); + access, STI_##stiSuffix, fieldValue, std::string_view(#sfName).substr(2).data(), ##__VA_ARGS__); #define TYPED_SFIELD(sfName, stiSuffix, fieldValue, ...) \ SF_##stiSuffix const sfName( \ - access, \ - STI_##stiSuffix, \ - fieldValue, \ - std::string_view(#sfName).substr(2).data(), \ - ##__VA_ARGS__); + access, STI_##stiSuffix, fieldValue, std::string_view(#sfName).substr(2).data(), ##__VA_ARGS__); // SFields which, for historical reasons, do not follow naming conventions. SField const sfInvalid(access, -1, ""); diff --git a/src/libxrpl/protocol/XChainAttestations.cpp b/src/libxrpl/protocol/XChainAttestations.cpp index 7c887e785b..8c8e792059 100644 --- a/src/libxrpl/protocol/XChainAttestations.cpp +++ b/src/libxrpl/protocol/XChainAttestations.cpp @@ -536,7 +536,7 @@ XChainCreateAccountAttestation::XChainCreateAccountAttestation(STObject const& o o[sfWasLockingChainSend] != 0, o[sfDestination]} {}; -XChainCreateAccountAttestation ::XChainCreateAccountAttestation(json::Value const& v) +XChainCreateAccountAttestation::XChainCreateAccountAttestation(json::Value const& v) : XChainCreateAccountAttestation{ json::getOrThrow(v, sfAttestationSignerAccount), json::getOrThrow(v, sfPublicKey), diff --git a/src/libxrpl/tx/transactors/lending/LoanSet.cpp b/src/libxrpl/tx/transactors/lending/LoanSet.cpp index 8425b8a55a..470484a596 100644 --- a/src/libxrpl/tx/transactors/lending/LoanSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanSet.cpp @@ -447,7 +447,7 @@ LoanSet::doApply() if (!brokerOwnerSle) return tefBAD_LEDGER; // LCOV_EXCL_LINE - auto const vaultSle = view.peek(keylet ::vault(brokerSle->at(sfVaultID))); + auto const vaultSle = view.peek(keylet::vault(brokerSle->at(sfVaultID))); if (!vaultSle) return tefBAD_LEDGER; // LCOV_EXCL_LINE auto const vaultPseudo = vaultSle->at(sfAccount); diff --git a/src/test/app/ValidatorList_test.cpp b/src/test/app/ValidatorList_test.cpp index bd7e8d1096..545ac23a92 100644 --- a/src/test/app/ValidatorList_test.cpp +++ b/src/test/app/ValidatorList_test.cpp @@ -1620,7 +1620,7 @@ private: std::make_pair(valKeys.cbegin(), valKeys.cend() - 4), std::make_pair(valKeys.cbegin() + 1, valKeys.cend() - 2), std::make_pair(valKeys.cbegin() + 2, valKeys.cend()), - }; + }; auto addPublishedList = [&, this](int i) { auto const publisherSecret = randomSecretKey(); @@ -1710,7 +1710,7 @@ private: std::make_pair(valKeys.cbegin(), valKeys.cend() - 4), std::make_pair(valKeys.cbegin() + 1, valKeys.cend() - 2), std::make_pair(valKeys.cbegin() + 2, valKeys.cend()), - }; + }; auto addPublishedList = [&, this]( diff --git a/src/test/app/lending/LoanBroker_test.cpp b/src/test/app/lending/LoanBroker_test.cpp index 2f8f71c060..e1ed2bb3ba 100644 --- a/src/test/app/lending/LoanBroker_test.cpp +++ b/src/test/app/lending/LoanBroker_test.cpp @@ -1601,7 +1601,7 @@ class LoanBroker_test : public beast::unit_test::Suite // issuer has already issued MaximumAmount. MaximumAmount is // default. {kMaxMpTokenAmount, std::nullopt, 250, tecINSUFFICIENT_FUNDS}, - }; + }; for (auto const& [pay, max, deposit, err] : mptTests) { test([&](Env& env) -> std::tuple {