Skip to content

Commit 22e999c

Browse files
authored
Change default phase ordering for scalafmt phase. (#1347)
Change default phase ordering for `scalafmt` phase. (#1347)
1 parent e942d94 commit 22e999c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

scala/scalafmt/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ declare_deps_provider(
4040
visibility = ["//visibility:public"],
4141
deps = [
4242
"@com_geirsson_metaconfig_core",
43+
"@org_scalameta_common",
4344
"@org_scalameta_parsers",
4445
"@org_scalameta_scalafmt_core",
46+
"@org_scalameta_scalameta",
47+
"@org_scalameta_trees",
4548
],
4649
)
4750

scala/scalafmt/phase_scalafmt_ext.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def _scalafmt_singleton_implementation(ctx):
4545
return [
4646
_ScalaRulePhase(
4747
custom_phases = [
48-
("$", "", "scalafmt", _phase_scalafmt),
48+
# Placed before `runfiles` phase so the captured outputs and sources during creation of the
49+
# `TARGET.format-test` output script are made available as runfiles to other downstream
50+
# targets (for instance, a wrapping `sh_test` target which invokes that `TARGET.format-test`
51+
# script). This allows them to by symlinked into the runfiles tree and thus accessible when
52+
# run via `bazel test`.
53+
("-", "runfiles", "scalafmt", _phase_scalafmt),
4954
],
5055
),
5156
]

0 commit comments

Comments
 (0)