Skip to content

Commit 7f26a0f

Browse files
redsun82Copilot
andcommitted
Just: say why these two imports are in this order
The first definition of a variable wins, so the optional internal file has to come before the stub that stands in for it. Reversed, the stub wins even where the real file exists and that checkout quietly behaves as if it were external. Worth a comment rather than trusting the reader's intuition, which says last wins, and because this repository cannot catch the mistake: the file is never present here, so both orders evaluate identically. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent c02acdc commit 7f26a0f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

misc/just/defs.just

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# The first definition of a variable wins, not the last, so this order is what lets the
2+
# internal file set `SEMMLE_CODE` while the stub is the fallback when it is absent.
3+
# Swapped, the stub wins even where the real file exists and that checkout then behaves
4+
# as if it were external. Nothing here can catch that: with the file absent, as it
5+
# always is in this repository, both orders evaluate the same.
16
import? '../../../semmle-code.just' # internal repo just file, if present
27
import 'semmle-code-stub.just'
38

0 commit comments

Comments
 (0)