chore: add readability-isolate-declaration to .clang-tidy - #419
Conversation
| #include <gtest/gtest.h> | ||
|
|
||
| #include "iceberg/catalog.h" | ||
| #include "iceberg/table.h" |
There was a problem hiding this comment.
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.
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.
If we change std::unique_ptr<Table> to std::shared_ptr<Table> like #418, we don't need to get the complete definition.
| #include <gtest/gtest.h> | ||
|
|
||
| #include "iceberg/catalog.h" | ||
| #include "iceberg/table.h" |
There was a problem hiding this comment.
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.