-
Notifications
You must be signed in to change notification settings - Fork 381
expand clang-tidy checks to category/rpc #1885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves const-correctness across the codebase by refactoring the mutation analyzer, adding const qualifiers to variables and parameters, adding explicit constructors, and including the category/rpc directory in clang-tidy checks.
- Refactored
ExprAutoMutationAnalyzer::isUnevaluatedto be a simpler static method with clearer API - Added
constqualifiers to many local variables, parameters, and return values throughout the codebase - Added
explicitkeyword to single-parameter constructors to prevent implicit conversions - Fixed forwarding references to use
std::forwardinstead ofstd::move
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/clang-tidy-auto-const/ExprAutoMutationAnalyzer.hpp | Simplified isUnevaluated method signature and moved it to public static |
| utils/clang-tidy-auto-const/ExprAutoMutationAnalyzer.cpp | Refactored isUnevaluated implementation with updated matcher logic |
| scripts/check-clang-tidy.sh | Added category/rpc to directories checked by clang-tidy |
| category/rpc/monad_executor_test.cpp | Added const qualifiers to test variables and fixed pointer declarations |
| category/rpc/monad_executor.cpp | Improved const-correctness and removed unnecessary std::move on const variables |
| category/mpt/*.hpp | Added explicit constructors, NOLINT suppressions, and improved const-correctness |
| category/execution/ethereum/state3/account_state.hpp | Updated move semantics for account initialization |
| category/execution/ethereum/rlp/*.hpp | Improved type safety in arithmetic operations and const-correctness |
| category/execution/ethereum/db/*.hpp | Added explicit constructors for database classes |
| category/execution/ethereum/trace/prestate_tracer.hpp | Added explicit constructors for tracer classes |
| category/core/lru/lru_cache.hpp | Made RAII lock holders const and improved constructors |
| category/core/mem/batch_mem_pool.hpp | Added explicit constructor |
| category/core/hash.hpp | Added NOLINT for sizeof expression in hash function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5212e50 to
446c732
Compare
446c732 to
dedf373
Compare
da67e9c to
1ef5b00
Compare
- disable performance-move-const-arg.CheckTriviallyCopyableMove as it provides no performance improvement and makes the code unstable for future changes.
1ef5b00 to
a13ede5
Compare
Required backporting a fix for a clang-tidy bug from upstream llvm.