Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Cover cpplint for
src/ray/pubsub
(#50732)
<!-- Thank you for your contribution! Please review https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before opening a pull request. --> <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? As part of the initiative to introduce cpplint into the pre-commit hook, we are gradually cleaning up C++ folders to ensure compliance with code style requirements. This issue focuses on cleaning up `src/ray/pubsub`. <!-- Please give a short summary of the change and the problem this solves. --> - This is the command that I have ran ``` cpplint \ --filter=-whitespace/line_length,\ -build/c++11,\ -build/c++14,\ -build/c++17,\ -readability/braces,\ -whitespace/indent_namespace,\ -runtime/int,\ -runtime/references,\ -build/include_order \ src/ray/pubsub/*.h \ src/ray/pubsub/*.cc \ src/ray/pubsub/**/*.h \ src/ray/pubsub/**/*.cc ``` - The log output ``` Skipping input 'src/ray/pubsub/**/*.h': Can't open for reading src/ray/pubsub/publisher.cc:416: Add #include <memory> for make_unique<> [build/include_what_you_use] [4] src/ray/pubsub/publisher.cc:442: Add #include <utility> for move [build/include_what_you_use] [4] src/ray/pubsub/publisher.cc:504: Add #include <vector> for vector<> [build/include_what_you_use] [4] src/ray/pubsub/publisher.cc:543: Add #include <string> for string [build/include_what_you_use] [4] Done processing src/ray/pubsub/publisher.cc src/ray/pubsub/publisher.h:94: Single-parameter constructors should be marked explicit. [runtime/explicit] [4] src/ray/pubsub/publisher.h:309: Add #include <vector> for vector<> [build/include_what_you_use] [4] src/ray/pubsub/publisher.h:316: Add #include <utility> for move [build/include_what_you_use] [4] src/ray/pubsub/publisher.h:454: Add #include <memory> for unique_ptr<> [build/include_what_you_use] [4] Done processing src/ray/pubsub/publisher.h src/ray/pubsub/subscriber.cc:319: Add #include <memory> for make_unique<> [build/include_what_you_use] [4] src/ray/pubsub/subscriber.cc:461: Add #include <vector> for vector<> [build/include_what_you_use] [4] src/ray/pubsub/subscriber.cc:482: Add #include <utility> for move [build/include_what_you_use] [4] src/ray/pubsub/subscriber.cc:522: Add #include <string> for string [build/include_what_you_use] [4] Done processing src/ray/pubsub/subscriber.cc src/ray/pubsub/subscriber.h:332: Add #include <vector> for vector<> [build/include_what_you_use] [4] src/ray/pubsub/subscriber.h:413: Add #include <string> for string [build/include_what_you_use] [4] src/ray/pubsub/subscriber.h:492: Add #include <memory> for unique_ptr<> [build/include_what_you_use] [4] src/ray/pubsub/subscriber.h:497: Add #include <utility> for pair<> [build/include_what_you_use] [4] Done processing src/ray/pubsub/subscriber.h src/ray/pubsub/test/integration_test.cc:173: Add #include <utility> for move [build/include_what_you_use] [4] src/ray/pubsub/test/integration_test.cc:234: Add #include <vector> for vector<> [build/include_what_you_use] [4] Done processing src/ray/pubsub/test/integration_test.cc src/ray/pubsub/test/publisher_test.cc:30: Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5] src/ray/pubsub/test/publisher_test.cc:613: Add #include <memory> for make_shared<> [build/include_what_you_use] [4] src/ray/pubsub/test/publisher_test.cc:827: Add #include <algorithm> for max [build/include_what_you_use] [4] src/ray/pubsub/test/publisher_test.cc:1063: Add #include <vector> for vector<> [build/include_what_you_use] [4] src/ray/pubsub/test/publisher_test.cc:1248: Add #include <string> for string [build/include_what_you_use] [4] Done processing src/ray/pubsub/test/publisher_test.cc src/ray/pubsub/test/subscriber_test.cc:23: Extra space before [ [whitespace/braces] [5] src/ray/pubsub/test/subscriber_test.cc:239: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:245: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:282: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:292: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:298: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:299: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:328: Consider using ASSERT_EQ instead of ASSERT_TRUE(a == b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:379: Consider using ASSERT_GT instead of ASSERT_TRUE(a > b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:410: Consider using ASSERT_GT instead of ASSERT_TRUE(a > b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:418: Consider using ASSERT_GT instead of ASSERT_TRUE(a > b) [readability/check] [2] src/ray/pubsub/test/subscriber_test.cc:108: Add #include <utility> for move [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:118: Add #include <deque> for deque<> [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:119: Add #include <queue> for queue<> [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:208: Add #include <memory> for shared_ptr<> [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:209: Add #include <unordered_map> for unordered_map<> [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:210: Add #include <unordered_set> for unordered_set<> [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:909: Add #include <string> for string [build/include_what_you_use] [4] src/ray/pubsub/test/subscriber_test.cc:930: Add #include <vector> for vector<> [build/include_what_you_use] [4] Done processing src/ray/pubsub/test/subscriber_test.cc Total errors found: 42 ``` > I've separated the changes for each cpplint error into separate commits. ## Related issue number <!-- For example: "Closes #1234" --> Closes #50728 ## Checks - [x] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [x] I've run `scripts/format.sh` to lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/. - [ ] I've added any new APIs to the API Reference. For example, if I added a method in Tune, I've added it in `doc/source/tune/api/` under the corresponding `.rst` file. - [x] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [ ] Unit tests - [ ] Release tests - [ ] This PR is not tested :( --------- Signed-off-by: Cheyu Wu <[email protected]>
- Loading branch information