Skip to content

Commit 97ee088

Browse files
redsun82Copilot
andcommitted
Just: say that these variables are an interface, not an implementation detail
`set allow-duplicate-variables` lets a consuming root replace any of them, and `just` cannot warn about an assignment that no longer overrides anything: renaming one leaves the root parsing, listing and passing CI while silently falling back to the value here, losing only the variable that moved. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 33c6c4f commit 97ee088

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

misc/just/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ instead replaces it, and then both run, each over the files of the repository th
6363
defines it: bazel formatting asks bazel from the root of the checkout the files belong
6464
to, so that a repository formats its own files with its own pin.
6565

66+
That last part is arranged by variables rather than by recipes. `set
67+
allow-duplicate-variables` in `defs.just` lets an importing justfile assign a variable
68+
defined here and have its value win, which is how a consuming root points the bazel
69+
formatter at its own workspace, its own buildifier and its own exclusions. The leading
70+
underscore says these are not meant to be run, not that they are private: any of them a
71+
root might reasonably want to redirect is an interface between the two repositories.
72+
73+
Renaming one is therefore a breaking change that nothing reports. `just` has no notion
74+
of an assignment that fails to override, so a root assigning the old name keeps parsing,
75+
keeps listing, keeps passing CI, and silently reverts to the value here. Worse, a root
76+
overriding several loses only the renamed one, leaving a half-applied configuration.
77+
Rename freely, but say so when handing the change over.
78+
6679
A directory that only makes sense when named explicitly can opt out of being found from
6780
above:
6881

0 commit comments

Comments
 (0)