Skip to content

"shellformat.flag" is ignored #409

@antichris

Description

@antichris

The extension v7.2.8 does not pass the value of shellformat.flag to the shfmt command, at all.

Repro

  1. 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"
  2. Set "shellformat.flag" to any valid shfmt flag, e.g., "-p -bn -ci".

  3. Invoke the extension as the formatter on any of the supported file types.

  4. Inspect the /tmp/shfmt-args.log log file.

  5. 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 -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions