fix: More clang-tidy issues - #6992
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses additional clang-tidy findings across xrpld, libxrpl, protocol headers, and tests by tightening include dependencies and ensuring deterministic member initialization.
Changes:
- Add missing direct includes in multiple compilation units (protocol/ledger/rpc/app/test) to satisfy header/tooling requirements.
- Initialize a number of class/struct members with in-class
{}to silence uninitialized-member diagnostics. - Modernize a few spots (e.g.,
std::ranges::is_sorted, defaulted ctors,<=>forSignerEntryordering) to satisfy tidy checks.
Reviewed changes
Copilot reviewed 59 out of 59 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/xrpld/rpc/handlers/orderbook/AMMInfo.cpp | Add missing protocol feature include |
| src/xrpld/app/misc/detail/ValidatorList.cpp | Add missing overlay message include |
| src/xrpld/app/misc/TxQ.h | Value-initialize members to avoid uninitialized reads |
| src/xrpld/app/misc/FeeVoteImpl.cpp | Add missing protocol include |
| src/xrpld/app/main/Application.cpp | Add protocol includes used by implementation |
| src/xrpld/app/ledger/detail/OpenLedger.cpp | Add missing protocol SField include |
| src/xrpld/app/ledger/detail/LedgerPersistence.cpp | Add missing protocol includes |
| src/xrpld/app/ledger/detail/InboundLedger.cpp | Add missing protocol includes |
| src/xrpld/app/ledger/detail/BuildLedger.cpp | Add missing protocol includes |
| src/test/rpc/DepositAuthorized_test.cpp | Add missing protocol include for constants/types |
| src/test/jtx/ter.h | Value-initialize optional member |
| src/test/jtx/impl/amount.cpp | Add missing <limits> include |
| src/test/jtx/credentials.h | Value-initialize const vector member |
| src/test/jtx/ManualTimeKeeper.h | Value-initialize atomic member |
| src/test/jtx/JTx.h | Value-initialize members/containers |
| src/test/jtx/Env.h | Value-initialize owning pointers/containers |
| src/test/core/Config_test.cpp | Add missing system-parameters include |
| src/test/app/PayChan_test.cpp | Include cleanup + add Zero header |
| src/libxrpl/tx/transactors/nft/NFTokenMint.cpp | Include cleanup + add STObject/iterator |
| src/libxrpl/tx/transactors/lending/LoanDelete.cpp | Add missing Number/STAmount includes |
| src/libxrpl/tx/transactors/delegate/DelegateSet.cpp | Include cleanup + add Journal include |
| src/libxrpl/tx/transactors/account/SignerListSet.cpp | Use std::ranges::is_sorted |
| src/libxrpl/tx/Transactor.cpp | Add missing Serializer include |
| src/libxrpl/protocol/STValidation.cpp | Add missing KeyType include |
| src/libxrpl/protocol/STNumber.cpp | Add missing Rules include |
| src/libxrpl/protocol/STInteger.cpp | Add missing <system_error> include |
| src/libxrpl/protocol/Quality.cpp | Add missing Zero/limits includes |
| src/libxrpl/ledger/helpers/OfferHelpers.cpp | Add missing LedgerFormats include |
| src/libxrpl/ledger/helpers/NFTokenHelpers.cpp | Add missing UintTypes include |
| src/libxrpl/ledger/helpers/CredentialHelpers.cpp | Include cleanup + add STObject include |
| src/libxrpl/ledger/PaymentSandbox.cpp | Add missing Issue include |
| include/xrpl/tx/paths/detail/Steps.h | Value-initialize FlowException::ter |
| include/xrpl/tx/applySteps.h | Value-initialize result members |
| include/xrpl/tx/Transactor.h | Value-initialize preflightResult |
| include/xrpl/tx/SignerEntries.h | Replace operator< with <=> for ordering |
| include/xrpl/shamap/SHAMap.h | Value-initialize internal containers/stacks |
| include/xrpl/rdb/DatabaseCon.h | Value-initialize pointer member |
| include/xrpl/protocol/STPathSet.h | Value-initialize internal vectors |
| include/xrpl/protocol/STBitString.h | Value-initialize internal value |
| include/xrpl/protocol/STArray.h | Value-initialize internal vector |
| include/xrpl/protocol/PathAsset.h | Value-initialize variant |
| include/xrpl/protocol/KnownFormats.h | Default ctor + in-class member initializers |
| include/xrpl/protocol/Book.h | Value-initialize optional member |
| include/xrpl/ledger/detail/ReadViewFwdRange.h | Value-initialize unique_ptr |
| include/xrpl/ledger/detail/RawStateTable.h | Value-initialize unique_ptr |
| include/xrpl/ledger/detail/ApplyStateTable.h | Value-initialize map member |
| include/xrpl/ledger/Dir.h | Value-initialize iterator member |
| include/xrpl/ledger/CanonicalTXSet.h | Value-initialize map member |
| include/xrpl/ledger/CachedView.h | Value-initialize cache map |
| include/xrpl/core/PeerReservationTable.h | Value-initialize unordered_set |
| include/xrpl/core/JobTypes.h | Value-initialize map member |
| include/xrpl/core/ClosureCounter.h | Value-initialize stored closure |
| include/xrpl/beast/unit_test/reporter.h | Value-initialize vector member |
| include/xrpl/beast/core/LockFreeStack.h | Default ctor + value-init node ptr |
| include/xrpl/basics/partitioned_unordered_map.h | Value-initialize iterators |
| include/xrpl/basics/hardened_hash.h | In-class seed init + defaulted ctor |
| include/xrpl/basics/TaggedCache.h | Value-initialize time_points |
| include/xrpl/basics/SlabAllocator.h | Value-initialize static_vector |
| include/xrpl/basics/Buffer.h | Use Slice::empty() for clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6992 +/- ##
=======================================
Coverage 82.6% 82.6%
=======================================
Files 1010 1010
Lines 79566 79566
Branches 7537 7531 -6
=======================================
+ Hits 65696 65708 +12
+ Misses 13870 13858 -12
🚀 New features to boost your workflow:
|
|
@bthomee I made a bunch of changes to get tests to pass, you may want to re-review (should be mostly a subset of what you already reviewed) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
High Level Overview of Change
Title pretty much says it all
No change in functionality, just clang-tidy things
Context of Change
Ran into several of these in PRs
API Impact
N/A