style: More clang-tidy identifier renaming - #7290
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #7290 +/- ##
=========================================
- Coverage 82.1% 82.1% -0.0%
=========================================
Files 1010 1010
Lines 76164 76157 -7
Branches 7423 7416 -7
=========================================
- Hits 62509 62495 -14
- Misses 13655 13662 +7
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates identifier naming to align the codebase with clang-tidy’s readability-identifier-naming configuration (including adding explicit Public/Protected/Private member case rules) and then performs broad, mechanical renames across runtime and test code to match those rules.
Changes:
- Extend
.clang-tidynaming rules to explicitly set Public/Protected/Private member case handling. - Rename many member variables and config fields from underscore/SCREAMING_SNAKE patterns to
camelBack(and apply suffix rules where appropriate). - Update call sites and unit tests to use the new member/config names.
Reviewed changes
Copilot reviewed 160 out of 160 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .clang-tidy | Add explicit Public/Protected/Private member case options. |
| include/xrpl/beast/unit_test/reporter.h | Rename result-tracking members to camelBack. |
| include/xrpl/basics/scope.h | Rename Scope* internal members to camelBack. |
| include/xrpl/basics/TaggedCache.h | Rename stats/entry fields to camelBack. |
| include/xrpl/basics/TaggedCache.ipp | Update TaggedCache implementation to match renamed fields. |
| include/xrpl/core/Coro.ipp | Rename coroutine mutex member to camelBack. |
| include/xrpl/core/Job.h | Rename queue_time_ member to camelBack. |
| include/xrpl/core/JobQueue.h | Rename job-count gauge and mutex member to camelBack. |
| include/xrpl/ledger/BookDirs.h | Rename iterator/root tracking members to camelBack. |
| include/xrpl/ledger/detail/RawStateTable.h | Rename PMR resource pointer member to camelBack. |
| include/xrpl/ledger/OpenView.h | Rename PMR resource pointer member to camelBack. |
| include/xrpl/net/HTTPClientSSLContext.h | Rename SSL context member to camelBack. |
| include/xrpl/protocol/Book.h | Rename hasher data members to camelBack. |
| include/xrpl/protocol/ErrorCodes.h | Rename ErrorInfo HTTP status member to camelBack. |
| include/xrpl/protocol/STPathSet.h | Rename STPathElement cached fields to camelBack. |
| include/xrpl/protocol/STTx.h | Rename private tx type member to camelBack. |
| include/xrpl/resource/detail/Entry.h | Rename balance fields to camelBack. |
| include/xrpl/resource/detail/Key.h | Rename hasher member to camelBack. |
| include/xrpl/resource/detail/Logic.h | Update resource logic to use renamed Entry fields. |
| include/xrpl/server/Handoff.h | Rename keep-alive field to camelBack. |
| include/xrpl/server/Port.h | Rename Port/ParsedPort public fields to camelBack. |
| include/xrpl/server/detail/BaseHTTPPeer.h | Rename peer internals (remote address, buffers, counters) to camelBack. |
| include/xrpl/server/detail/BasePeer.h | Rename remote address member to camelBack. |
| include/xrpl/server/detail/BaseWSPeer.h | Rename websocket peer internals to camelBack; update Port option access. |
| include/xrpl/server/detail/Door.h | Rename accept throttling fields and remote address member to camelBack. |
| include/xrpl/server/detail/PlainHTTPPeer.h | Update to renamed BaseHTTPPeer/Handoff members. |
| include/xrpl/server/detail/ServerImpl.h | Rename io_context member to camelBack and update usage. |
| include/xrpl/server/detail/SSLHTTPPeer.h | Rename SSL HTTP peer stream ptr/read buffer/request count/remote addr uses. |
| include/xrpl/server/detail/SSLWSPeer.h | Rename SSL WS peer stream ptr member to camelBack. |
| src/libxrpl/basics/ResolverAsio.cpp | Rename resolver internals (ioContext, stopCalled, etc.). |
| src/libxrpl/beast/insight/StatsDCollector.cpp | Rename StatsD collector io_context and gauge tracking fields. |
| src/libxrpl/core/detail/Job.cpp | Rename queue time member to camelBack. |
| src/libxrpl/core/detail/JobQueue.cpp | Rename gauge member to camelBack and update collection code. |
| src/libxrpl/ledger/BookDirs.cpp | Rename iterator tracking fields to camelBack and update traversal logic. |
| src/libxrpl/ledger/OpenView.cpp | Rename PMR resource pointer member to camelBack. |
| src/libxrpl/protocol/ErrorCodes.cpp | Update ErrorCodes accessor to renamed httpStatus field. |
| src/libxrpl/protocol/STTx.cpp | Rename tx type member to camelBack and update uses. |
| src/libxrpl/server/Port.cpp | Update port parsing/printing code to renamed Port/ParsedPort members. |
| src/test/app/AMM_test.cpp | Update fee config access to fees.referenceFee. |
| src/test/app/AMMMPT_test.cpp | Rename test locals/struct fields to camelBack; update fees config access. |
| src/test/app/LedgerHistory_test.cpp | Update fees config access to fees.toFees(). |
| src/test/app/LedgerLoad_test.cpp | Update startup/ledger/trap hash config fields to camelBack. |
| src/test/app/LedgerMaster_test.cpp | Update networkId and fees config fields to camelBack. |
| src/test/app/LedgerReplay_test.cpp | Update ledgerReplay config access in tests. |
| src/test/app/LoadFeeTrack_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/app/MPToken_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/app/NetworkID_test.cpp | Update networkId config field to camelBack. |
| src/test/app/Path_test.cpp | Update path search config fields to camelBack. |
| src/test/app/PathMPT_test.cpp | Update path search config fields to camelBack. |
| src/test/app/RCLValidations_test.cpp | Update fees config access to fees.toFees(). |
| src/test/app/Regression_test.cpp | Update fees config access to fees.toFees() / fees.referenceFee. |
| src/test/app/SHAMapStore_test.cpp | Update ledgerHistory config field to camelBack. |
| src/test/app/Transaction_ordering_test.cpp | Update forceMultiThread config field to camelBack. |
| src/test/app/TxQ_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/app/ValidatorList_test.cpp | Update protocol header field access to renamed messageType. |
| src/test/consensus/Consensus_test.cpp | Update consensus parms member access to camelBack. |
| src/test/consensus/Validations_test.cpp | Update validation parms member access to camelBack. |
| src/test/core/Coroutine_test.cpp | Update forceMultiThread config field to camelBack. |
| src/test/csf/Scheduler.h | Rename intrusive container member from by_when_ to byWhen_. |
| src/test/jtx/impl/AMMTest.cpp | Update path search config fields to camelBack. |
| src/test/jtx/impl/Env.cpp | Update SSL verify config fields to camelBack. |
| src/test/jtx/impl/envconfig.cpp | Update unit-test config defaults to renamed fees / betaRpcApi / sslVerify / ioWorkers. |
| src/test/jtx/impl/JSONRPCClient.cpp | Rename rpc version member to camelBack and update usage. |
| src/test/jtx/impl/permissioned_dex.cpp | Rename USD IOU member to usd and update trust/pay usage. |
| src/test/jtx/impl/TestHelpers.cpp | Update path search config fields to camelBack. |
| src/test/jtx/impl/WSClient.cpp | Rename rpc version member to camelBack and update usage. |
| src/test/jtx/impl/xchain_bridge.cpp | Rename alt signers/reward fields to camelBack and update ctor init. |
| src/test/jtx/permissioned_dex.h | Rename USD IOU member to usd. |
| src/test/jtx/xchain_bridge.h | Rename test fixture fields to camelBack. |
| src/test/ledger/SkipList_test.cpp | Update fees config access to fees.toFees(). |
| src/test/ledger/View_test.cpp | Update fees config access to fees.toFees(). |
| src/test/nodestore/Database_test.cpp | Update ledgerHistory config field to camelBack. |
| src/test/nodestore/Timing_test.cpp | Rename distribution and default parameter members to camelBack. |
| src/test/overlay/compression_test.cpp | Update protocol header field access and config fields to camelBack. |
| src/test/overlay/short_read_test.cpp | Rename io_context member to ioContext_ and update dependent objects. |
| src/test/overlay/tx_reduce_relay_test.cpp | Update tx reduce-relay config fields and rename buffer member. |
| src/test/peerfinder/PeerFinder_test.cpp | Update peers config field names to camelBack. |
| src/test/rpc/AccountTx_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/rpc/Book_test.cpp | Update PermissionedDEX USD member access to usd. |
| src/test/rpc/DeliveredAmount_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/rpc/JSONRPC_test.cpp | Update networkId and fees config fields to camelBack. |
| src/test/rpc/LedgerClosed_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/rpc/LedgerEntry_test.cpp | Update fees and startup config fields to camelBack. |
| src/test/rpc/LedgerRequest_test.cpp | Update fees and nodeSize config fields to camelBack. |
| src/test/rpc/LedgerRPC_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/rpc/NoRippleCheck_test.cpp | Update renamed resource entry field to localBalance. |
| src/test/rpc/RPCCall_test.cpp | Update networkId config field to camelBack. |
| src/test/rpc/Simulate_test.cpp | Update networkId config field to camelBack. |
| src/test/rpc/Subscribe_test.cpp | Update fees config access and PermissionedDEX USD member access. |
| src/test/rpc/Transaction_test.cpp | Update networkId and fees config fields to camelBack. |
| src/test/rpc/TransactionEntry_test.cpp | Update fees config access to fees.referenceFee. |
| src/test/rpc/Transaction_test.cpp | Update fee/network config access to camelBack. |
| src/test/rpc/Version_test.cpp | Update betaRpcApi config field usage in tests. |
| src/test/server/ServerStatus_test.cpp | Update elbSupport config field usage in tests. |
| src/test/server/Server_test.cpp | Rename io_context member to ioContext_ in helper thread. |
| src/test/unit_test/multi_runner.h | Rename shared-memory and queue members to camelBack. |
| src/xrpld/app/ledger/LedgerHistory.cpp | Update cache/counter member names and fees config access. |
| src/xrpld/app/ledger/LedgerHistory.h | Rename cache/counter members to camelBack. |
| src/xrpld/app/ledger/LedgerMaster.h | Rename internal cache/config members to camelBack. |
| src/xrpld/app/ledger/OpenLedger.h | Rename mutex members to camelBack. |
| src/xrpld/app/ledger/detail/LedgerCleaner.cpp | Update fees config access to fees.toFees(). |
| src/xrpld/app/ledger/detail/LedgerMaster.cpp | Update config accesses and rename internal members to camelBack. |
| src/xrpld/app/ledger/detail/OpenLedger.cpp | Update mutex usage to renamed members. |
| src/xrpld/app/main/BasicApp.cpp | Rename io_context member to ioContext_ and update worker setup. |
| src/xrpld/app/main/BasicApp.h | Rename io_context member to ioContext_ and getter return. |
| src/xrpld/app/main/Main.cpp | Update many Config fields (startup, ledger, trap hash, rpc endpoint, etc.) to camelBack. |
| src/xrpld/app/misc/detail/ValidatorSite.cpp | Update lock member names to camelBack throughout implementation. |
| src/xrpld/app/misc/detail/WorkSSL.cpp | Update SSL verify config field usage to camelBack. |
| src/xrpld/app/misc/FeeVoteImpl.cpp | Update fee target field names to camelBack and reflow long call. |
| src/xrpld/app/misc/SHAMapStoreImp.cpp | Update config field names and SavedStateDB member name to camelBack. |
| src/xrpld/app/misc/SHAMapStoreImp.h | Rename SavedStateDB member to stateDb_ and update accessors. |
| src/xrpld/app/misc/ValidatorSite.h | Rename mutex members to camelBack. |
| src/xrpld/consensus/Consensus.cpp | Update consensus parms member accesses to camelBack. |
| src/xrpld/consensus/Consensus.h | Update consensus parms member accesses to camelBack. |
| src/xrpld/consensus/ConsensusParms.h | Rename ConsensusParms public constants to camelBack. |
| src/xrpld/consensus/DisputedTx.h | Update consensus parms member accesses to camelBack. |
| src/xrpld/consensus/Validations.h | Rename validation parms to camelBack and update logic uses. |
| src/xrpld/overlay/Message.h | Rename once_flag_ member to camelBack. |
| src/xrpld/overlay/Slot.h | Update config field access to camelBack. |
| src/xrpld/overlay/detail/ConnectAttempt.cpp | Update overlay handshake feature config accesses to camelBack. |
| src/xrpld/overlay/detail/Handshake.cpp | Update server domain and feature config accesses to camelBack. |
| src/xrpld/overlay/detail/Message.cpp | Update std::call_once to renamed flag member. |
| src/xrpld/overlay/detail/OverlayImpl.cpp | Rename io_context/id/timer fields and update config accesses. |
| src/xrpld/overlay/detail/OverlayImpl.h | Rename io_context/id/timer fields to camelBack. |
| src/xrpld/overlay/detail/PeerImp.cpp | Update many config accesses to camelBack and reformat logs. |
| src/xrpld/overlay/detail/PeerImp.h | Update feature config accesses and reformat log line. |
| src/xrpld/overlay/detail/ProtocolMessage.h | Rename message header fields to camelBack and update parsing/invocation. |
| src/xrpld/overlay/detail/TxMetrics.cpp | Rename counter member usage to n. |
| src/xrpld/overlay/detail/TxMetrics.h | Rename counter member N to n. |
| src/xrpld/peerfinder/detail/Counts.h | Rename counters/max fields to camelBack and update accounting logic. |
| src/xrpld/peerfinder/detail/PeerfinderConfig.cpp | Update config field access to camelBack. |
| src/xrpld/peerfinder/detail/SlotImp.cpp | Rename endpoint/listening port members to camelBack. |
| src/xrpld/peerfinder/detail/SlotImp.h | Rename endpoint/listening port members to camelBack and update accessors. |
| src/xrpld/rpc/detail/AssetCache.h | Rename AccountKey cached hash field to camelBack. |
| src/xrpld/rpc/detail/Pathfinder.cpp | Rename convert-all flag member to camelBack and update logic. |
| src/xrpld/rpc/detail/Pathfinder.h | Rename convert-all flag member to camelBack. |
| src/xrpld/rpc/detail/PathRequest.cpp | Rename convert-all flag and reply timepoints to camelBack; update config accesses. |
| src/xrpld/rpc/detail/PathRequest.h | Rename convert-all flag and reply timepoints to camelBack. |
| src/xrpld/rpc/detail/RPCCall.cpp | Update client config/port admin field access to camelBack. |
| src/xrpld/rpc/detail/RPCHandler.cpp | Update betaRpcApi config access. |
| src/xrpld/rpc/detail/RPCSub.cpp | Rename io_context member to camelBack and update call. |
| src/xrpld/rpc/detail/Role.cpp | Update Port admin/secure gateway and admin credential member accesses. |
| src/xrpld/rpc/detail/ServerHandler.cpp | Rename insight counters/events to camelBack; update betaRpcApi and port fields. |
| src/xrpld/rpc/detail/TransactionSign.cpp | Update path search/beta RPC/fees config accesses to camelBack. |
| src/xrpld/rpc/detail/WSInfoSub.h | Update port secure gateway net member accesses. |
| src/xrpld/rpc/handlers/orderbook/PathFind.cpp | Update path search config access to camelBack. |
| src/xrpld/rpc/handlers/orderbook/RipplePathFind.cpp | Update path search config access to camelBack. |
| src/xrpld/rpc/handlers/server_info/Version.h | Update betaRpcApi config access. |
| src/xrpld/rpc/json_body.h | Rename writer buffer member to camelBack and update access. |
| src/xrpld/rpc/ServerHandler.h | Rename admin credentials and insight metrics members to camelBack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| boost::asio::ip::address ip; | ||
| std::uint16_t port = 0; | ||
| std::set<std::string, boost::beast::iless> protocol; | ||
| std::vector<boost::asio::ip::network_v4> admin_nets_v4; | ||
| std::vector<boost::asio::ip::network_v6> admin_nets_v6; | ||
| std::vector<boost::asio::ip::network_v4> secure_gateway_nets_v4; | ||
| std::vector<boost::asio::ip::network_v6> secure_gateway_nets_v6; | ||
| std::vector<boost::asio::ip::network_v4> adminNetsV4; | ||
| std::vector<boost::asio::ip::network_v6> adminNetsV6; | ||
| std::vector<boost::asio::ip::network_v4> secureGatewayNetsV4; | ||
| std::vector<boost::asio::ip::network_v6> secureGatewayNetsV6; | ||
| std::string user; | ||
| std::string password; | ||
| std::string admin_user; | ||
| std::string admin_password; | ||
| std::string ssl_key; | ||
| std::string ssl_cert; | ||
| std::string ssl_chain; | ||
| std::string ssl_ciphers; | ||
| boost::beast::websocket::permessage_deflate pmd_options; | ||
| std::string adminUser; | ||
| std::string adminPassword; | ||
| std::string sslKey; | ||
| std::string sslCert; | ||
| std::string sslChain; | ||
| std::string sslCiphers; | ||
| boost::beast::websocket::permessage_deflate pmdOptions; |
There was a problem hiding this comment.
I realise that but also we don't typically care as the only possible consumer is Clio atm.
| // If both mutex are to be locked at the same time, `sites_mutex_` must be | ||
| // locked before `state_mutex_` or we may deadlock. | ||
| std::mutex mutable sites_mutex_; | ||
| std::mutex mutable state_mutex_; | ||
| std::mutex mutable sitesMutex_; | ||
| std::mutex mutable stateMutex_; |
| // A parent process will periodically increment `keep_alive_`. The child | ||
| // processes will check if `keep_alive_` is being incremented. If it is | ||
| // not incremented for a sufficiently long time, the child will assume | ||
| // the parent process has died. | ||
| std::atomic<std::size_t> keep_alive{0}; | ||
| std::atomic<std::size_t> keepAlive{0}; |
mathbunnyru
left a comment
There was a problem hiding this comment.
- This is probably
style - Could you make similar changes in Clio
High Level Overview of Change
@kuznetsss noticed that some member variables are still misaligned with our configuration. Turns out clang-tidy does not respect the
readability-identifier-naming.MemberCase: camelBackcorrectly and requires few extra lines for public/protected/private members when suffix is setup for those.API Impact
No impact.