The extension v7.2.8 does not pass the value of shellformat.flag to the shfmt command, at all.
Repro
-
Wrap the shfmt binary in a wrapper that logs the args:
SHFMT=$(which shfmt)
mv "$SHFMT" "$SHFMT.bin"
cat >"$SHFMT" <<-***
#!/bin/sh
echo "\$(date +%FT%T.%N)" "\$@" >> /tmp/shfmt-args.log
"$SHFMT.bin" "\$@"
***
chmod +x "$SHFMT"
-
Set "shellformat.flag" to any valid shfmt flag, e.g., "-p -bn -ci".
-
Invoke the extension as the formatter on any of the supported file types.
-
Inspect the /tmp/shfmt-args.log log file.
-
Cleanup:
SHFMT=$(which shfmt)
mv "$SHFMT.bin" "$SHFMT"
Want
File is formatted according to the flag values.
One or more log entries containing the flag values, e.g.:
2026-04-11T00:49:48.741834778 --filename=/home/user/foo/test.sh -i=0 -ln=auto -p -bn -ci -
Got
File is formatted in the default shfmt style.
The flag values are absent from the logs:
2026-04-11T00:49:48.741834778 --filename=/home/user/foo/test.sh -i=0 -ln=auto -
The extension v7.2.8 does not pass the value of
shellformat.flagto theshfmtcommand, at all.Repro
Wrap the
shfmtbinary in a wrapper that logs the args:Set
"shellformat.flag"to any validshfmtflag, e.g.,"-p -bn -ci".Invoke the extension as the formatter on any of the supported file types.
Inspect the
/tmp/shfmt-args.loglog file.Cleanup:
Want
File is formatted according to the flag values.
One or more log entries containing the flag values, e.g.:
Got
File is formatted in the default
shfmtstyle.The flag values are absent from the logs: