-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
//tools/rustfmt
to dynamically work within rules_rust
its…
…elf (#883)
- Loading branch information
1 parent
1e4fbe3
commit d5a9d8c
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""A helper module for the `@rules_rust//tools/rustfmt` package""" | ||
|
||
def aspect_repository(): | ||
"""Determines the repository name to use for the `rustfmt_manifest` aspect in `rustfmt` binaries. | ||
The `//tools/rustfmt` target has a hard coded `--aspects` command built into it. | ||
This function is designed to allow for this aspect to be updated to work within | ||
the `rules_rust` repository itself since aspects do not work if the repository name | ||
is explicitly set. | ||
https://github.com/bazelbuild/rules_rust/issues/749 | ||
Returns: | ||
str: The string to use for the `rustfmt_aspect` repository | ||
""" | ||
if native.repository_name() == "@": | ||
return "" | ||
return native.repository_name() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters