Open caspertsui opened 2 years ago
This is a known upstream bug caveat.
The shfmt README lists this as a caveat, and suggests:
When indexing Bash associative arrays, always use quotes.
demonstration:
# key surrounded with 'single quotes'
$ echo "array=(['hyphened-key']=value )" | shfmt
array=(['hyphened-key']=value)
# key with "double quotes"
$ echo 'array=(["hyphened-key"]=value )' | shfmt
array=(["hyphened-key"]=value)
Hello,
This bug is serious if it's enabled "format on save" feature.
would be formatted as
for shell scripts which breaks 1 single key into 3.
Thanks and regards, Alan