chore: Enable clang-tidy bugprone-unused-return-value check - #6475
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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-valuein.clang-tidyand configureCheckedReturnTypes. - Add targeted
NOLINT(bugprone-unused-return-value)/NOLINTNEXTLINE(bugprone-unused-return-value)suppressions for Boost.Asioclose,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.
High Level Overview of Change
This PR enables clang-tidy
bugprone-unused-return-valuecheck.There is potentially a way to fix those by defining
BOOST_ASIO_NO_DEPRECATEDor 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
.gitignore, formatting, dropping support for older tooling)API Impact
No impact.
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)