Skip to content

Commit

Permalink
bazel lint C++
Browse files Browse the repository at this point in the history
Signed-off-by: dentiny <[email protected]>
  • Loading branch information
dentiny committed Feb 25, 2025
1 parent 03308ae commit 3de65ed
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 59 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ repos:
args: ["--filter=-whitespace/braces,-whitespace/line_length,-build/c++11,-build/c++14,-build/c++17,-readability/braces,-whitespace/indent_namespace,-runtime/int,-runtime/references,-build/include_order"]
files: ^src/ray/(util|raylet_client|scheduling|pubsub|rpc(?:/.*)?)/.*\.(h|cc)$

- repo: https://github.com/keith/pre-commit-buildifier
rev: 8.0.1
hooks:
- id: buildifier
files: ^src/ray(?:/[^/]+)*/BUILD$
- id: buildifier-lint
files: ^src/ray(?:/[^/]+)*/BUILD$

- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
Expand Down
10 changes: 5 additions & 5 deletions src/ray/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ ray_cc_library(
hdrs = [
"asio/asio_chaos.h",
"asio/asio_util.h",
"asio/postable.h",
"asio/instrumented_io_context.h",
"asio/io_service_pool.h",
"asio/periodical_runner.h",
"asio/postable.h",
],
deps = [
":event_stats",
Expand Down Expand Up @@ -259,15 +259,15 @@ ray_cc_library(
ray_cc_library(
name = "ray_syncer",
srcs = [
"ray_syncer/ray_syncer.cc",
"ray_syncer/node_state.cc",
"ray_syncer/ray_syncer.cc",
"ray_syncer/ray_syncer_client.cc",
"ray_syncer/ray_syncer_server.cc",
],
hdrs = [
"ray_syncer/ray_syncer.h",
"ray_syncer/node_state.h",
"ray_syncer/common.h",
"ray_syncer/node_state.h",
"ray_syncer/ray_syncer.h",
"ray_syncer/ray_syncer_bidi_reactor.h",
"ray_syncer/ray_syncer_bidi_reactor_base.h",
"ray_syncer/ray_syncer_client.h",
Expand Down Expand Up @@ -309,7 +309,7 @@ ray_cc_library(
deps = [
":macros",
":status",
"@com_google_absl//absl/base:core_headers"
"@com_google_absl//absl/base:core_headers",
],
)

Expand Down
2 changes: 1 addition & 1 deletion src/ray/common/cgroup/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ray_cc_library(
deps = [
":cgroup_context",
"//src/ray/util",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)
2 changes: 1 addition & 1 deletion src/ray/common/cgroup/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ray_cc_test(
size = "small",
srcs = ["cgroup_v2_utils_test.cc"],
tags = [
"manual", # Expect cgroupv2 mount, not intended for unit test and CI.
"team:core",
"manual", # Expect cgroupv2 mount, not intended for unit test and CI.
],
deps = [
"//src/ray/common/cgroup:cgroup_setup",
Expand Down
11 changes: 7 additions & 4 deletions src/ray/common/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//bazel:ray.bzl", "ray_cc_test", "ray_cc_library", "ray_cc_binary")
load("//bazel:ray.bzl", "ray_cc_binary", "ray_cc_library", "ray_cc_test")

ray_cc_test(
name = "resource_request_test",
Expand Down Expand Up @@ -159,9 +159,9 @@ ray_cc_test(

ray_cc_library(
name = "testing",
testonly = True,
hdrs = ["testing.h"],
deps = ["//src/ray/util:macros"],
testonly = True,
)

ray_cc_test(
Expand Down Expand Up @@ -197,7 +197,10 @@ ray_cc_test(
srcs = [
"memory_monitor_test.cc",
],
tags = ["team:core", "no_windows"],
tags = [
"no_windows",
"team:core",
],
target_compatible_with = [
"@platforms//os:linux",
],
Expand Down Expand Up @@ -234,5 +237,5 @@ ray_cc_test(
"//src/ray/common:grpc_util",
"//src/ray/protobuf:common_cc_proto",
"@com_google_googletest//:gtest_main",
]
],
)
22 changes: 14 additions & 8 deletions src/ray/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package(default_visibility = ["//visibility:public"])

load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test")
load("@rules_proto_grpc//python:defs.bzl", "python_grpc_compile")

package(default_visibility = ["//visibility:public"])

proto_library(
name = "common_proto",
srcs = ["common.proto"],
Expand Down Expand Up @@ -250,11 +250,11 @@ proto_library(
name = "export_event_proto",
srcs = ["export_api/export_event.proto"],
deps = [
":export_task_event_proto",
":export_node_event_proto",
":export_actor_event_proto",
":export_driver_job_event_proto",
":export_submission_job_event_proto"
":export_node_event_proto",
":export_submission_job_event_proto",
":export_task_event_proto",
],
)

Expand All @@ -271,7 +271,10 @@ python_grpc_compile(
proto_library(
name = "export_task_event_proto",
srcs = ["export_api/export_task_event.proto"],
deps = [":common_proto", ":export_runtime_env_proto"],
deps = [
":common_proto",
":export_runtime_env_proto",
],
)

cc_proto_library(
Expand Down Expand Up @@ -333,7 +336,10 @@ python_grpc_compile(
proto_library(
name = "export_driver_job_event_proto",
srcs = ["export_api/export_driver_job_event.proto"],
deps = [":common_proto", ":export_runtime_env_proto"],
deps = [
":common_proto",
":export_runtime_env_proto",
],
)

cc_proto_library(
Expand Down
8 changes: 4 additions & 4 deletions src/ray/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ray_cc_library(

ray_cc_library(
name = "env",
hdrs = ["env.h"],
srcs = ["env.cc"],
hdrs = ["env.h"],
deps = [
":logging",
],
Expand Down Expand Up @@ -144,8 +144,8 @@ ray_cc_library(

ray_cc_library(
name = "scoped_env_setter",
hdrs = ["scoped_env_setter.h"],
srcs = ["scoped_env_setter.cc"],
hdrs = ["scoped_env_setter.h"],
deps = [
":env",
],
Expand Down Expand Up @@ -257,8 +257,8 @@ ray_cc_library(

ray_cc_library(
name = "compat",
hdrs = ["compat.h"],
srcs = ["compat.cc"],
hdrs = ["compat.h"],
deps = [
":logging",
"//src/ray/common:status",
Expand All @@ -283,9 +283,9 @@ ray_cc_library(
":util",
"//src/ray/common:ray_config",
"@boost//:iostreams",
"@com_github_spdlog//:spdlog",
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/strings",
"@com_github_spdlog//:spdlog",
],
)

Expand Down
Loading

0 comments on commit 3de65ed

Please sign in to comment.