Sponsored Content
Skip to content

chore: Enable clang-tidy bugprone-unused-return-value check - #6475

Merged
bthomee merged 7 commits into
XRPLF:developfrom
godexsoft:chore/clang-tidy-checks-unused-return-value
Mar 16, 2026
Merged

chore: Enable clang-tidy bugprone-unused-return-value check#6475
bthomee merged 7 commits into
XRPLF:developfrom
godexsoft:chore/clang-tidy-checks-unused-return-value

Conversation

@godexsoft

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR enables clang-tidy bugprone-unused-return-value check.

There is potentially a way to fix those by defining BOOST_ASIO_NO_DEPRECATED or even rewrite parts to use more modern asio API. But that's a much larger, scary and unrelated to clang-tidy effort. So for now we just nolint these because the code works fine as is.

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

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 Trivial Simple change with minimal effect, or already tested. Only needs one approval. DraftRunCI Normally CI does not run on draft PRs. This opts in. labels Mar 4, 2026
@codecov

codecov Bot commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.8%. Comparing base (1738a69) to head (d7e003d).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/overlay/detail/ConnectAttempt.cpp 0.0% 1 Missing ⚠️
src/xrpld/overlay/detail/PeerImp.cpp 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6475     +/-   ##
=========================================
- Coverage     79.8%   79.8%   -0.0%     
=========================================
  Files          878     878             
  Lines        67885   67885             
  Branches      7547    7554      +7     
=========================================
- Hits         54206   54194     -12     
- Misses       13679   13691     +12     
Files with missing lines Coverage Δ
src/libxrpl/basics/make_SSLContext.cpp 56.3% <ø> (ø)
src/libxrpl/beast/insight/StatsDCollector.cpp 0.0% <ø> (ø)
src/libxrpl/net/RegisterSSLCerts.cpp 100.0% <ø> (ø)
src/xrpld/overlay/detail/ConnectAttempt.cpp 0.0% <0.0%> (ø)
src/xrpld/overlay/detail/PeerImp.cpp 5.9% <0.0%> (ø)

... and 6 files 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 removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 9, 2026
@godexsoft
godexsoft marked this pull request as ready for review March 9, 2026 13:50

Copilot AI 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.

Pull request overview

Enables the clang-tidy bugprone-unused-return-value check and suppresses newly reported findings in a few Boost.Asio call sites where the return value is intentionally ignored (code relies on the error_code& out-param behavior and/or the operation is best-effort).

Changes:

  • Turn on bugprone-unused-return-value in .clang-tidy and configure CheckedReturnTypes.
  • Add targeted NOLINT(bugprone-unused-return-value) / NOLINTNEXTLINE(bugprone-unused-return-value) suppressions for Boost.Asio close, shutdown, and SSL context setup calls.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.clang-tidy Enables bugprone-unused-return-value and sets CheckedReturnTypes.
src/xrpld/overlay/detail/PeerImp.cpp Suppresses unused-return-value warning on socket_.close(ec) in peer shutdown path.
src/xrpld/overlay/detail/ConnectAttempt.cpp Suppresses unused-return-value warning on socket_.close(ec) in connection attempt shutdown.
src/tests/libxrpl/net/HTTPClient.cpp Suppresses unused-return-value warning on TCP socket shutdown in test server coroutine.
src/test/server/Server_test.cpp Suppresses unused-return-value warning on TCP socket shutdown in unit tests.
src/libxrpl/net/RegisterSSLCerts.cpp Suppresses unused-return-value warning on set_default_verify_paths(ec).
src/libxrpl/beast/insight/StatsDCollector.cpp Suppresses unused-return-value warning on UDP socket shutdown.
src/libxrpl/basics/make_SSLContext.cpp Suppresses unused-return-value warning on SSL context certificate/private key file loading.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pratikmankawde pratikmankawde 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

@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 16, 2026
@bthomee
bthomee enabled auto-merge (squash) March 16, 2026 13:50
@bthomee
bthomee merged commit 918185e into XRPLF:develop Mar 16, 2026
2 of 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
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. Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants