Skip to content

Commit 2ec54c8

Browse files
redsun82Copilot
andcommitted
Just: let the bazel formatter ask where it is, like the other three
Of the four formatters here, only the bazel one did not check for an internal repository checkout, so a consumer wanting its own launcher had to restate the whole command line to change one word. An override that large is indistinguishable from a stale copy of the default, and it was one. The path is absolute rather than relative to `_bazel_workspace`, so the launcher and the workspace stop having to be overridden together to stay consistent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent c01e76d commit 2ec54c8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

misc/just/format.just

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ _cpp_formatter := if SEMMLE_CODE != "" { "uv run clang-format" } else { "clang-f
1616
# hence `_bazel` in build.just going the other way.
1717
_bazel_workspace := quote(parent_directory(parent_directory(source_dir())))
1818

19-
_bazel_formatter := "bazel run --noshow_progress --ui_event_filters=,+error,+fail @buildifier_prebuilt//:buildifier --"
19+
# As with the formatters above, an internal repository checkout has its own launcher and
20+
# that is the one to use. Unlike `_bazel` in build.just it is not `cd`ed to: the workspace
21+
# is picked by `--chdir` below, so the launcher only has to be found, not entered.
22+
_bazel_formatter := (if SEMMLE_CODE != "" { '"$SEMMLE_CODE/tools/bazel"' } else { "bazel" }) + " run --noshow_progress --ui_event_filters=,+error,+fail @buildifier_prebuilt//:buildifier --"
2023

2124
# bazel files are named rather than suffixed, and buildifier has no exclude option of its
2225
# own, so the files skipped by the target above are skipped here too. That target formats

0 commit comments

Comments
 (0)