Skip to content
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

Updated //tools/rustfmt to dynamically work within rules_rust itself #883

Merged
merged 3 commits into from
Aug 12, 2021

Conversation

UebelAndre
Copy link
Collaborator

This should make it less annoying to format .rs files within the rules_rust workspace since previously I'd have to apply a diff to get it to run:

diff --git a/tools/rustfmt/srcs/main.rs b/tools/rustfmt/srcs/main.rs
index f1d95c6..99ef4eb 100644
--- a/tools/rustfmt/srcs/main.rs
+++ b/tools/rustfmt/srcs/main.rs
@@ -76,7 +76,7 @@ fn query_rustfmt_targets(options: &Config) -> Vec<String> {
 fn generate_rustfmt_target_manifests(options: &Config, targets: &[String]) {
     let build_args = vec![
         "build",
-        "--aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect",
+        "--aspects=//rust:defs.bzl%rustfmt_aspect",
         "--output_groups=rustfmt_manifest",
     ];

@google-cla google-cla bot added the cla: yes label Aug 10, 2021
Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, given the bazel constraint :)

@UebelAndre UebelAndre merged commit d5a9d8c into bazelbuild:main Aug 12, 2021
@UebelAndre UebelAndre deleted the rustfmt branch August 12, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants