-
Notifications
You must be signed in to change notification settings - Fork 76
chore: add readability-isolate-declaration to .clang-tidy #419
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
src/iceberg/test/mock_catalog.h
Outdated
| #include <gtest/gtest.h> | ||
|
|
||
| #include "iceberg/catalog.h" | ||
| #include "iceberg/table.h" |
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.
Fix a bug. Otherwise clang-tidy checks would fail when someone else modified this file.
The reasion is MOCK_METHOD((Result<std::unique_ptr<Table>>), ... will instantiate std::expected<std::unique_ptr<Table>> but Table here is just a forward declaration so std::unique_ptr will fail to generate destructor.
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.
Yeah, I remember in the test file if include mock_catalog.h without including table.h, it will fail to compile.
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.
If we change std::unique_ptr<Table> to std::shared_ptr<Table> like #418, we don't need to get the complete definition.
src/iceberg/test/mock_catalog.h
Outdated
| #include <gtest/gtest.h> | ||
|
|
||
| #include "iceberg/catalog.h" | ||
| #include "iceberg/table.h" |
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.
Yeah, I remember in the test file if include mock_catalog.h without including table.h, it will fail to compile.
Add this rule to avoid defining multiple variables on the same line.