Skip to content

Commit

Permalink
Unbreak manual rustfmt invocations via Bazel (#617)
Browse files Browse the repository at this point in the history
Fixes #618
  • Loading branch information
aaronmondal committed Jan 18, 2024
1 parent 249322d commit f39e275
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 35 deletions.
1 change: 0 additions & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ignore = ["nativelink-proto/genproto/lib.rs"]
max_width = 120
reorder_imports = true
imports_granularity = "Module"
Expand Down
5 changes: 2 additions & 3 deletions nativelink-proto/gen_lib_rs_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


def print_package_part_to_mod(tree, indents = 0):
tabs = " " * indents
tabs = " " * indents
if tree["filename"] is not None:
print('%sinclude!("%s");' % (tabs, tree["filename"]))

Expand All @@ -59,7 +59,7 @@ def main():
help='pb.rs files used to generate lib.rs')
args = parser.parse_args()
print(_HEADER)
print("")

tree_root = { "children": {}, "filename": None }
for filepath in args.files:
filepath = os.path.relpath(os.path.normpath(filepath), args.rootdir)
Expand All @@ -76,7 +76,6 @@ def main():
cur_node["filename"] = '.'.join(package_parts) + '.pb.rs'

print_package_part_to_mod(tree_root)
print("")


if __name__ == "__main__":
Expand Down
60 changes: 29 additions & 31 deletions nativelink-proto/genproto/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,42 @@
// This file is auto-generated. To update it, run:
// `bazel run proto:update_protos`


pub mod build {
pub mod bazel {
pub mod remote {
pub mod execution {
pub mod v2 {
include!("build.bazel.remote.execution.v2.pb.rs");
pub mod bazel {
pub mod remote {
pub mod execution {
pub mod v2 {
include!("build.bazel.remote.execution.v2.pb.rs");
}
}
}
pub mod semver {
include!("build.bazel.semver.pb.rs");
}
}
}
pub mod semver {
include!("build.bazel.semver.pb.rs");
}
}
}
pub mod com {
pub mod github {
pub mod trace_machina {
pub mod nativelink {
pub mod remote_execution {
include!("com.github.trace_machina.nativelink.remote_execution.pb.rs");
pub mod github {
pub mod trace_machina {
pub mod nativelink {
pub mod remote_execution {
include!("com.github.trace_machina.nativelink.remote_execution.pb.rs");
}
}
}
}
}
}
}
pub mod google {
pub mod api {
include!("google.api.pb.rs");
}
pub mod bytestream {
include!("google.bytestream.pb.rs");
}
pub mod longrunning {
include!("google.longrunning.pb.rs");
}
pub mod rpc {
include!("google.rpc.pb.rs");
}
pub mod api {
include!("google.api.pb.rs");
}
pub mod bytestream {
include!("google.bytestream.pb.rs");
}
pub mod longrunning {
include!("google.longrunning.pb.rs");
}
pub mod rpc {
include!("google.rpc.pb.rs");
}
}

0 comments on commit f39e275

Please sign in to comment.