chore: Enable clang-tidy bugprone-inc-dec-in-conditions check - #6455
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enables the bugprone-inc-dec-in-conditions clang-tidy check and refactors a couple of existing call sites to avoid increment/decrement side effects inside conditional expressions.
Changes:
- Enable
bugprone-inc-dec-in-conditionsin.clang-tidy. - Refactor
BookDirs::const_iterator::operator++()to remove++cur_key_from a conditional expression. - Refactor JSON surrogate-pair parsing to avoid
current++inside a conditional expression.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.clang-tidy |
Turns on the bugprone-inc-dec-in-conditions check and removes it from the “disabled due to issues” list. |
src/libxrpl/ledger/BookDirs.cpp |
Reworks iterator advancement logic to avoid increment in the if condition. |
src/libxrpl/json/json_reader.cpp |
Rewrites surrogate-pair detection to avoid pointer increments in the if condition and keep parsing behavior explicit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bugprone-inc-dec-in-conditions check
…om:godexsoft/rippled into chore/clang-tidy-checks-inc-dec-conditions
High Level Overview of Change
This PR enables the
bugprone-inc-dec-in-conditionscheck.Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)