Sponsored Content
Skip to content

refactor: Enable more clang-tidy readability checks - #6595

Merged
bthomee merged 17 commits into
XRPLF:developfrom
godexsoft:refactor/clang-tidy-readability-2
Mar 24, 2026
Merged

refactor: Enable more clang-tidy readability checks#6595
bthomee merged 17 commits into
XRPLF:developfrom
godexsoft:refactor/clang-tidy-readability-2

Conversation

@godexsoft

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR enables the following checks:

  • readability-convert-member-functions-to-static
  • readability-implicit-bool-conversion
  • readability-math-missing-parentheses
  • readability-simplify-boolean-expr
  • readability-suspicious-call-argument

For some of them NOLINTs have been added (for things like to_string or some functions that should not be static but clang-tidy insists).
The other two checks that are left (other than the huge identifier-naming one - #6571) I think we want to leave out:

  • readability-inconsistent-declaration-parameter-name - in this codebase this check will break a lot of arg names because clang-tidy will take names from .cpp file and match them in .h files. this breaks doxygen where present as well as most names in .cpp files are much worse than the ones currently in headers.
  • readability-static-accessed-through-instance - this check is probably unnecessary. it makes the code less readable for many types like types based on base_uint for example.

Context of Change

API Impact

No impact.

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@godexsoft godexsoft added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 19, 2026
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.49393% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.5%. Comparing base (8b986e4) to head (7f274dd).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/libxrpl/shamap/SHAMapSync.cpp 63.6% 4 Missing ⚠️
src/xrpld/app/misc/SHAMapStoreImp.cpp 50.0% 4 Missing ⚠️
src/xrpld/overlay/detail/OverlayImpl.cpp 20.0% 4 Missing ⚠️
src/xrpld/app/misc/detail/ValidatorList.cpp 71.4% 2 Missing ⚠️
src/xrpld/app/rdb/backend/detail/Node.cpp 0.0% 2 Missing ⚠️
src/xrpld/overlay/detail/PeerImp.cpp 0.0% 2 Missing ⚠️
src/libxrpl/basics/make_SSLContext.cpp 0.0% 1 Missing ⚠️
src/libxrpl/rdb/SociDB.cpp 66.7% 1 Missing ⚠️
src/xrpld/app/consensus/RCLConsensus.cpp 50.0% 1 Missing ⚠️
src/xrpld/app/consensus/RCLCxPeerPos.cpp 0.0% 1 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6595   +/-   ##
=======================================
  Coverage     81.4%   81.5%           
=======================================
  Files          997     997           
  Lines        74415   74410    -5     
  Branches      7561    7555    -6     
=======================================
- Hits         60611   60608    -3     
+ Misses       13804   13802    -2     
Files with missing lines Coverage Δ
include/xrpl/core/JobQueue.h 100.0% <ø> (ø)
include/xrpl/protocol/Serializer.h 94.8% <ø> (ø)
include/xrpl/shamap/SHAMap.h 100.0% <ø> (ø)
include/xrpl/tx/ApplyContext.h 100.0% <ø> (ø)
include/xrpl/tx/invariants/InvariantCheck.h 100.0% <ø> (ø)
src/libxrpl/basics/Number.cpp 98.7% <100.0%> (ø)
src/libxrpl/basics/ResolverAsio.cpp 91.0% <100.0%> (ø)
src/libxrpl/basics/StringUtilities.cpp 95.2% <100.0%> (ø)
src/libxrpl/basics/base64.cpp 100.0% <100.0%> (ø)
src/libxrpl/beast/insight/StatsDCollector.cpp 0.0% <ø> (ø)
... and 141 more

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@godexsoft
godexsoft marked this pull request as ready for review March 23, 2026 19:07
@godexsoft godexsoft removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 23, 2026

@kuznetsss kuznetsss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few suggestions

Comment thread include/xrpl/protocol/Serializer.h Outdated
Comment thread src/libxrpl/basics/base64.cpp Outdated
godexsoft and others added 4 commits March 24, 2026 13:27
Comment thread src/test/app/PermissionedDEX_test.cpp Outdated
@godexsoft godexsoft added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Mar 24, 2026
@bthomee
bthomee added this pull request to the merge queue Mar 24, 2026
Merged via the queue into XRPLF:develop with commit 0eedefb Mar 24, 2026
3 checks passed
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
Co-authored-by: Sergey Kuznetsov <kuzzz99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants