Skip to content

Commit

Permalink
Fix Rust formatting when //:format is called in different subdirectory (
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeister authored Jul 15, 2024
1 parent ae48d99 commit 67a433c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions format/private/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
# --- end runfiles.bash initialization v3 ---

if [[ -n "$BUILD_WORKSPACE_DIRECTORY" ]]; then
# Needed for the rustfmt binary wrapper in rules_rust; see
# https://github.com/aspect-build/rules_lint/pull/327
unset BUILD_WORKING_DIRECTORY
cd $BUILD_WORKSPACE_DIRECTORY
elif [[ -n "$TEST_WORKSPACE" ]]; then
if [[ -n "$WORKSPACE" ]]; then
Expand Down

0 comments on commit 67a433c

Please sign in to comment.