You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bash extractor: $(fn) in an argument or a test gets no call edge (only x=$(fn) does, #2978) #5561
A function called inside $( ) gets a calls edge only when the substitution is a whole assignment value (x=$(fn), fixed in #2978).
Anywhere else a $(fn) is just as much a call, but Graphify drops it: in a command's argument (echo "at $(stamp)") and in a test ([ "$(stamp)" != "" ]).
Value-returning helpers used this way look dead.
Reproduced on graphifyy 0.9.122 (newest on PyPI), installed with pip, nothing patched, Python 3.12, Ubuntu.
Reproduction
Two files in a new git repo:
# bin/tool#!/usr/bin/env bash
ROOT="$(cd "$(dirname "$0")/.."&& pwd)"."$ROOT/lib/stamp.sh"main() {
echo"built at $(stamp)"
[ "$(stamp)"!="" ] &&echo ok
}
main
imports_from bin/tool -> lib/stamp.sh
calls bin/tool main -> lib/stamp.sh stamp
Got
calls bin/tool (script) -> bin/tool main
imports_from bin/tool -> lib/stamp.sh
Cause and fix
The call walk skips a command inside an expansion unless the expansion is an assignment's value.
The rule that fits bash: a $(fn) anywhere but in a statement's command-name position is a call.
This extends #2978 (assignment values) and narrows #2141 (calls into a sourced file) to the case still missing.
We carry this fix as a local patch and can open a PR.
Activity
github-actions commentedon Nov 28, 2026
Thanks for opening this issue, @yashsaxena. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(bash): a $(fn) in an argument or a test is a call (#5561)